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

Taxonomic weights not honored when ranging through .Pages #10406

Closed
jmooring opened this issue Oct 31, 2022 · 1 comment · Fixed by #10409
Closed

Taxonomic weights not honored when ranging through .Pages #10406

jmooring opened this issue Oct 31, 2022 · 1 comment · Fixed by #10409

Comments

@jmooring
Copy link
Member

jmooring commented Oct 31, 2022

Ref: https://gohugo.io/content-management/taxonomies/#order-taxonomies

When ranging through .Pages in a term template, the content pages were ordered by taxonomic weight in v0.64.1. This stopped working in v0.65.0.

Git bisect says b2dcd53 is the first bad commit.

Work-arounds (in a term template):

{{ range index site.Taxonomies .Data.Plural (urlize .Data.Term) }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}

OR

{{ range sort .Pages (printf "Params.%s_weight" .Data.Plural) }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}

Minimal example:

git clone --single-branch -b hugo-github-issue-10406 https://github.com/jmooring/hugo-testing hugo-github-issue-10406
cd hugo-github-issue-10406
hugo
@bep bep removed the NeedsTriage label Nov 1, 2022
@bep bep modified the milestones: v0.105.0, v0.105.1 Nov 1, 2022
bep added a commit to bep/hugo that referenced this issue Nov 1, 2022
@bep bep closed this as completed in #10409 Nov 1, 2022
bep added a commit that referenced this issue Nov 1, 2022
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants