Comments (4)
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.
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.
If you agree with me, please feel free to modify your PR and design a removeIndex
option for s.path()
?
from velite.
If you agree with me, please feel free to modify your PR and design a
removeIndex
option fors.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)
- How to pass in props to the built mdx code? HOT 2
- Virtual Collection Request HOT 7
- Error on top level array for JSON/YAML HOT 2
- Suggestion: Generate json schemas for json/yaml files HOT 1
- type inference doesn't work when using defineCollection HOT 1
- How to reference MDX images from the public folder without copying them to the public directory during the build. HOT 2
- The deployment on Vercel failed, it seems to be a bug? HOT 38
- Property 'content' does not exist on type 'ZodMeta'. HOT 3
- Image size detection for remote file
- content not building HOT 9
- s.image add option to not copy the file to a folder HOT 3
- Revise name of generated type HOT 1
- Imrpove DX on collection import HOT 2
- More framework or build tool integration examples HOT 1
- Array type pattern confuses typing HOT 1
- content not rebuilding when modify/change files under the 'content' directory using next 14.1.3 HOT 1
- Is there a way to add id to heading tags so that they can be used as anchor links? HOT 2
- I can display the main content - SyntaxError: Unexpected token '<' HOT 7
- Include image metadata from content source HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from velite.