digitalcraftsman / hugo-material-docs

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

Fix Prev and Next links in footer #18

Closed gravis closed 8 years ago

gravis commented 8 years ago

Also display section name if haschildren (refs #17)

Anyway:

gravis commented 8 years ago

After some tests, I'm not 100% now about this one. Hugo docs are pretty unclear about this, and it seems the more weight a content has, the "older" it is. Let me clarify that on the discussion board.

digitalcraftsman commented 8 years ago

Hello @gravis,

Giving each page a Weight seems painful, and impossible to maintain with big projects

What other approach would you suggest. Changing the weight in multiple files can be daunting. But this is the default way that Hugo supports. Hugo's docs are relatively large and uses the same approach. I would suggest to leave enough space between two weight. Use wider steps to weight pages. This allows you to sandwhich page B between page A and C without colliding with their weights.

The menu needs to be fixec for sections with children, currently all sections are "open" (again, not suitable for large projects)

The creator of the upstream project currently makes a refactoring. I opened an issue (see squidfunk/mkdocs-material#14) to fix this issue. Let's see how the redesign handles this problem.

How big is you documentation actually?

it seems the more weight a content has, the "older" it is.

By default pages a sorted by date. This works for blogs but doesn't make sense for documentations. Adding weights allows you to change the order (as you did in the pull request).

digitalcraftsman commented 8 years ago

Thanks again for your contribution. I merged this pull request as 23935a3a5f6a4c34e847065cc3ec13f0401f6c13.

Regards, Digitalcraftsman

gravis commented 8 years ago

Hugo is now heading towards next and previous links instead: https://raw.githubusercontent.com/spf13/hugo/master/docs/content/overview/installing.md

next: /overview/usage
prev: /overview/quickstart

Maybe it's only me :) I see a lot of negative weights too, this is very confusing for rookies like me

digitalcraftsman commented 8 years ago

I don't know why the Hugo docs use a combination of weights and prev, next links in the frontmatter. The weights are used to sort the menu on the left. Therefore, I expect the same order for the prev, next links (which should work fine with just the weights).

Maybe it's only me :) I see a lot of negative weights too, this is very confusing for rookies like me

There are other approaches, e.g. Hugo's companion MkDocs requires that you list every page manually in your prefered order in the config file.

However, in terms of documentation I see the menu the following way: within the config file I specify the section of the docs and use the weights there to order the section.

The pages inside a section should also be ordered somehow. That's mostly done with the weights in the frontmatter.

gravis commented 8 years ago

Is there any relation between the weights of the sections, and the weights of the pages? It should not, but I prefer to be sure :) thanks