8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From https://gohugo.io/methods/page/sections/:
With this content structure: content/ ├── auctions/ │ ├── 2023-11/ │ │ ├── _index.md <-- front matter: weight = 202311 │ │ ├── auction-1.md │ │ └── auction-2.md │ ├── 2023-12/ │ │ ├── _index.md <-- front matter: weight = 202312 │ │ ├── auction-3.md │ │ └── auction-4.md │ ├── _index.md <-- front matter: weight = 30 │ ├── bidding.md │ └── payment.md ├── books/ │ ├── _index.md <-- front matter: weight = 10 │ ├── book-1.md │ └── book-2.md ├── films/ │ ├── _index.md <-- front matter: weight = 20 │ ├── film-1.md │ └── film-2.md └── _index.md And this template: {{ range .Sections.ByWeight }} <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> {{ end }} On the home page, Hugo renders: <h2><a href="/films/">Films</a></h2> <h2><a href="/books/">Books</a></h2> <h2><a href="/auctions/">Auctions</a></h2>
With this content structure:
content/ ├── auctions/ │ ├── 2023-11/ │ │ ├── _index.md <-- front matter: weight = 202311 │ │ ├── auction-1.md │ │ └── auction-2.md │ ├── 2023-12/ │ │ ├── _index.md <-- front matter: weight = 202312 │ │ ├── auction-3.md │ │ └── auction-4.md │ ├── _index.md <-- front matter: weight = 30 │ ├── bidding.md │ └── payment.md ├── books/ │ ├── _index.md <-- front matter: weight = 10 │ ├── book-1.md │ └── book-2.md ├── films/ │ ├── _index.md <-- front matter: weight = 20 │ ├── film-1.md │ └── film-2.md └── _index.md
And this template:
{{ range .Sections.ByWeight }} <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> {{ end }}
On the home page, Hugo renders:
<h2><a href="/films/">Films</a></h2> <h2><a href="/books/">Books</a></h2> <h2><a href="/auctions/">Auctions</a></h2>
Since the weight of books is 10, it has the lowest weight, so shouldn't it be listed first?
The text was updated successfully, but these errors were encountered:
ca96976
No branches or pull requests
From https://gohugo.io/methods/page/sections/:
Since the weight of books is 10, it has the lowest weight, so shouldn't it be listed first?
The text was updated successfully, but these errors were encountered: