Giter Site home page Giter Site logo

Comments (4)

zce avatar zce commented on July 19, 2024

The design of the s.path() schema is to omit the 'index' automatically.

The main scenario I consider is that many times we will choose to put the assets related to a document in the same directory, and then name the document index.md. At this time, index.md is generally meaningless.

 ├── content
 │   ├── posts
 │   │   └── hello-world
 │   │       ├── cover.jpg
 │   │       └── index.md

I know what you're saying, but I don't know in what scenario the directory and file basename will be the same.

If there is indeed such a scenario, adding an option parameter would be a better choice.

from velite.

marcocondrache avatar marcocondrache commented on July 19, 2024

I get what you're saying. For my setup, I'm putting together a sidebar that uses the path property to figure out which post is currently selected. The issue crops up when I'm dealing with both architecture.md and a folder (with an index) – they end up with the same path, making it tricky to tell them apart. Your thoughts make sense, and while it might be a bit of a specific case, it's still possible. So, if you're cool with it, having an option for users to pick what works best for them would be great.

I forgot to evidence that a folder is represented as a submenu in the sidebar. So, to group all the posts together under one main category, I need to figure out if they're hanging out in a folder along the path. But when I've got two files with "product/architecture" (doing the folder thing), it gets tricky to tell if it's a folder (and a submenu) or not.

from velite.

zce avatar zce commented on July 19, 2024

If you agree with me, please feel free to modify your PR and design a removeIndex option for s.path()?

from velite.

marcocondrache avatar marcocondrache commented on July 19, 2024

If you agree with me, please feel free to modify your PR and design a removeIndex option for s.path()?

Yup, that would be perfect! I've modified the PR with the options to remove the index. Thank you!

from velite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.