Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left nav of docs layout not honoring order set by weight metadata #1130

Closed
3 tasks done
sdwheeler opened this issue Mar 14, 2025 · 2 comments · Fixed by #1131 or #1132
Closed
3 tasks done

Left nav of docs layout not honoring order set by weight metadata #1130

sdwheeler opened this issue Mar 14, 2025 · 2 comments · Fixed by #1131 or #1132
Labels
bug Something isn't working

Comments

@sdwheeler
Copy link
Contributor

Prerequisites

Describe the issue

I use the docs layout for a library of presentations that I have created. I want the sections to appear in the left nav in a specific order. I use weight: and navWeight: to manage the order. The result as built doesn't follow any understandable order. It's not alphabetical and it's not in weight order.

Steps to reproduce

My site: https://sdwheeler.github.io/seanonit/docs/ - Note the order of the left nav
Source: https://github.com/sdwheeler/seanonit/tree/main/content/docs - Note the weights for these items

Here is a list of the weights:

  • 01-contributedocs/_index.md: weight: 1 - navWeight: -1000
  • 02-opensource/_index.md: weight: 2 – navWeight: -2000
  • 03-markdown/_index.md: weight: 3 - navWeight: -3000
  • 04-github/_index.md: weight: 4 navWeight: -4000
  • 05-psprofiles/_index.md: weight: 5 - navWeight: -5000
  • 06-pshelp/_index.md: weight: 6 - navWeight: -6000
  • 07-crescendo/_index.md: weight: 7 - navWeight: -7000
  • 08-binding/_index.md: weight: 8 - navWeight: -8000
  • 09-git-fundamentals/_index.md: weight: 4 - navWeight: -4000

Expected behavior

I expect the weight metadata to control the order of appearance in the left nav

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Microsoft Edge

What version of theme are you using?

require github.com/razonyang/hugo-theme-bootstrap v1.9.3

What version of Hugo are you using?

go 1.23

What version of Node.js are you using?

v23.3.0

What version of Git are you using?

git version 2.48.1.windows.1

Additional context

No response

@sdwheeler sdwheeler added the bug Something isn't working label Mar 14, 2025
@razonyang
Copy link
Owner

Currently, the navigation on left sidebar are sorting with navWeight (must large than 0) parameter.

razonyang added a commit that referenced this issue Mar 15, 2025
fix: sorting docs navigation items in LinkTitle rather than Title

Closes #1130
@sdwheeler
Copy link
Contributor Author

sdwheeler commented Mar 16, 2025

@razonyang Thanks for the info and the update. I will try out 1.31 this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants