Menu and Pagintation Sorting #774
james-d-elliott
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been playing with the default sorting. This is the default per the hugo docs: https://gohugo.io/templates/lists/#default-weight--date--linktitle--filepath
This line (and additional lines similar to this) here can be replaced to make it sort initially by Weight then sort equivalent Weights by either the Title or LinkTitle:
https://github.com/h-enk/doks/blob/master/layouts/partials/sidebar/auto-collapsible-menu.html#L14
Then these lines:
https://github.com/h-enk/doks/blob/master/layouts/partials/main/docs-navigation.html#L4-L5
Can become:
This allows for you to have pages with equal weight which are sorted alphabetically and it keeps navigation intact. This is great for generated CLI docs for example, or for integration docs where there are heaps of integrations. The question is do we want this to be PR'd?
The default order is probably AMAZING for any content which you want to show up when it's new (date is the date it was created?). But probably nothing else unless you set weights religiously.
Beta Was this translation helpful? Give feedback.
All reactions