digitalcraftsman / hugo-material-docs

Port of Martin Donath's mkdocs-material theme to Hugo
MIT License
706 stars 186 forks source link

footer navigation for nested sections #43

Open lambdafu opened 8 years ago

lambdafu commented 8 years ago

Oh well. This probably needs to be a global configuration option. In my case, I want to use top level sections for parts in a multivolume book, and subsections for chapters in the individual volumes. Currently, the weights need to be globally unique and monotone across all sections and subsections for navigation to work as expected.

In my case, I prefer local weights within each book (among the subsections) and local weights for all menu entries.

This patch implements that.

First, it uses PrevInSection and NextInSection to link subsections together. If you use index pages for the sections (as enabled in #42), and give them the weight 0, they are linked into the flow at the beginning. Of course, all subsections should be in a book-specific directory.

The homepage footer has been removed. It didn't work properly anyway, using publication date to find the next link. Using subsections for the home page is not very useful, so there is no special support for that (I am not even sure how that would look like).

Unfortunately, this removes footers from the non-nested sections case entirely, and that's not proper. So, I think there should be a global configuration option to control this.

What do you think?

lambdafu commented 8 years ago

Fixes #4 (maybe).

lambdafu commented 8 years ago

Here is my example project illustrating this: https://github.com/lambdafu/hugo-material-book