How to link to the next post within a folder #2703
-
|
Hiya! I'm digging 11ty but I'm running into some trouble. I have a site that's currently set up with folders within folders. This is what it looks like roughly: I want to be able to automatically link to the next chapter within my layout for each chapter page instead of having to manually link each chapter. How can I achieve this? I've looked everywhere and got confused by a lot of different approaches. EDIT: I'd also like to make a list of links of each book, like a table of contents, and have that also available on each chapter page but that's another headache for another day. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
What about making each book its own collection, and then using something like https://www.11ty.dev/docs/filters/collection-items/#get-next-or-previous-collection-item-universal-filters for chapter navigation. |
Beta Was this translation helpful? Give feedback.
-
|
As for the table of contents (toc) idea, since you're using .md files, you could look at something like https://www.npmjs.com/package/markdown-it-toc (or one of the other probably dozen) TOC plugins, but that would probably only work on an individual file (so a chapter based TOC, which might not be entirely helpful). |
Beta Was this translation helpful? Give feedback.
What about making each book its own collection, and then using something like https://www.11ty.dev/docs/filters/collection-items/#get-next-or-previous-collection-item-universal-filters for chapter navigation.