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

lessons learned trying to get tag index pages working. need doc update? #6688

Closed
Dieterbe opened this issue Dec 30, 2019 · 2 comments
Closed
Labels

Comments

@Dieterbe
Copy link

Hello,
I'm not sure where the issue lies. perhaps https://gohugo.io/templates/taxonomy-templates/ or https://gohugo.io/templates/taxonomy-templates/#taxonomy-list-template or elsewhere.
but I spent a significant enough amount of time trying to get my tag listing working, so I think i should share. hopefully it helps others, and perhaps documentation can be improved.

I noticed that as of a recent upgrade, my tag listing pages simply started listing all my pages, rather than only the pages that have that tag.
I use a theme based on https://github.com/jaden/twentyfourteen by @jaden , which recently received a patch to accommodate gohugoio/hugoThemes#682 (jaden/twentyfourteen@89e9097). perhaps this is related to the issue as well.

According to the hugo docs, the tag listing pages (/tags/<tagname>) should "just work". the docs don't clearly state (though seem to imply) that the filtering is done by hugo, and not in the template. at least the docs interchangeably talk about listing pages whether they are unfiltered lists or regular lists (e.g. on
https://gohugo.io/templates/taxonomy-templates/#taxonomy-list-templates)

also from https://gohugo.io/templates/lists/ i couldn't really figure out where the filtering is done.
https://gohugo.io/templates/lists/#taxonomy-template shows a range over .Pages which I think is deprecated now.

Since I couldn't find resources on this topic, I ended up trying some other themes to see which work. which led me to "simple-style" which has it working.
looking at its layouts/_default/list.html file I saw that when I use {{ range .Paginator.Pages -}}, not {{ range where site.RegularPages "Type" "in" site.Params.mainSections }} it seems to work.

that said, i don't even use pagination, so i'm not sure if this is the proper solution...

@bep
Copy link
Member

bep commented Dec 30, 2019

Please post documentation related issues here: https://github.com/gohugoio/hugoDocs/issues

@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 Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants