hugo-material-docs icon indicating copy to clipboard operation
hugo-material-docs copied to clipboard

Ordering of elements in the main nav menu on the left is still broken

Open chhh opened this issue 7 years ago • 3 comments

There's:

  • date in front matter
  • weight in front matter
  • weight in the config

No matter what I'm changing - the order of elements stays the same in the nav menu.

Using Hugo 0.24.1

chhh avatar Jul 06 '17 22:07 chhh

In my case all menu items are ordered correctly but the first one (which has a weight of 0!) Have you tried setting the weight of the first menu item from 0 to 1 ? This seemed to fix the ordering for me.

maffelbaffel avatar Jul 22 '17 18:07 maffelbaffel

I had to remove dates everywhere and set a through numbering with weights for every top level page and every sub page, then it worked. And the numbering needs to be either strictly positive or strictly negative numbers. This is all weird..

On Jul 22, 2017 14:25, "maffelbaffel" [email protected] wrote:

In my case all menu items are ordered correctly but the first one (which has a weight of 0!) Have you tried setting the weight of the first menu item from 0 to 1 ? This seemed to fix the ordering for me.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/digitalcraftsman/hugo-material-docs/issues/71#issuecomment-317201530, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGlfosCPKV8TByWqhTUxztyTpULr_OKks5sQj6ggaJpZM4OQRmA .

chhh avatar Jul 22 '17 18:07 chhh

I guess its because of this line: https://github.com/gohugoio/hugo/blob/b2e3748a4e148a9624b9906bd8f34a238a54429c/hugolib/pageSort.go#L63

Dunno why they catch out these Weight == 0 cases. Edit: See https://github.com/gohugoio/hugo/issues/2673

maffelbaffel avatar Jul 22 '17 18:07 maffelbaffel