Closed joostdecock closed 6 years ago
It's good enough for me. Thanks for explanation! Could you add this into the documentation?
Yeah, if it gets merged, I plan to write up a section on all of this new stuff.
Longer term, I'd like to understand how the deployment of new versions and the docs site is organised. This is arguably the perfect module to have a kickin' documentation site ;)
I'm merging this into a (newly created) dev
branch as a sort of go-between solution as I'd like to consolidate these PRs, but feel it's perhaps best to not merge them into master without review by @apmontgomery
This PR adds support for breadcrumbs. Specifically, it adds a
breadcrumbs
config option (false
by default) that will generate breadcrumbs to map the path between the top level of your content directory to the current file.Example: Given this config:
and a content structure like this:
The following will happen:
about.md
andhelp.md
(1) orindex.md
(2) will not get any breadcrumbs added to it. That's because there are no intermediate steps between the root level and the pagefaq.md
will get an extra property in its attributes calledbreadcrumbs
. It will hold an array with for every step along the way (only one in this case) an object as such:Here's an example of what the content-api returns for a real (and deep) page:
This PR is most useful to people with a nested directory structure in their content directory. Adding breadcrumbs to your page layout is trivial this way.
Note: For this to work, you must have directory indexes for all the directories in your content directory. But if you're not doing that, then you risk 404 when a user manually goes up one leven in the URL anyway