-
Notifications
You must be signed in to change notification settings - Fork 35
Reflect Content Structure in Routing Structure #124
Comments
Maybe it would be possible to tie this together with the schema change discussed at #126. |
I've been thinking about this. The most sensible option seems to be to implement this as an Antwar plugin like prevnext currently. The algorithm would have to go through the entire path definition and attach the information there. I imagine it's not needed for all sites so that's another reason why a plugin feels like the right direction. |
Idk, a lot of other static site generators have this as the default behavior that can then be overridden (e.g. via the frontmatter in phenomic). Personally, I think this makes sense as it's more intuitive and easier to manage.
I think there may be some instances where overrides are needed but I can't picture that many sites where this wouldn't be the desired base behavior for the majority of routes/content. I guess it's not a huge deal to have it as a plugin but I think supporting it by default would make more sense. |
Ok. I guess I'll develop it as a plugin (easier to test etc.) and just enable the behavior by default. So it could become an opt-out if necessary. |
That sounds good, I can't argue with it being modularized and if we find out I'm wrong then it'll be even easier to fix 😁. |
There's something like this built-in now behind |
Sure we can also discuss more in webpack/webpack.js.org#980... it seems the data, |
Given the following antwar config:
and this content directory...
it would be great if antwar produced the routes and content in this manner:
/
- content fromindex.md
/another-page
- content fromanother-page.md
/examples
- content fromexamples/index.md
/examples/another-child
- content fromexamples/another-child.md
... and so on, treating each directory as a new route with children and the
index.md
file as the content for the base route. Then within thesection.all()
data, these pages would be represented as:This way your content structure always reflects your directory structure and much less manual configuration is needed to lay out your project (especially if all files are markdown).
The text was updated successfully, but these errors were encountered: