when I visit job-1 and click the tag: golang, I would like to list all jobs with this tag. [ --NOT list all jobs+events tagged with golang. by DEFAULT]
Depending on your theme, you’ll look up the template that is rendering your tag pages, and change the range on it to only show pages from your jobs section.
I was thinking they didn’t want events to show up at all, in which case they could just edit the single template to only show the jobs section. Then they’ll know if that is what they really want.
For content organization and status of my side-project (still developed on my mac-pc locally), I could point a theme for reference so that you can understand my question clearly: https://themes.gohugo.io/minimal/, and its github repository located at https://github.com/calintat/minimal
what I would like to get is:
1, when I visit Post Section and click Golang tag, list all Post Section pages tagged with Golang
2, when I visit Projects Section and click Golang tag, list all Project Section pages tagged with Golang
Almost same as what I am working on, so I take this theme as a example.
Thank you all again.
You can certainly do this, but not without customization of the theme, or finding a theme that is designed to do this (though I don’t know if any exist), unless you are willing to go with Option C below. Hugo’s tags work site-wide, and most if not all existing themes stick with that.
The approach you take depends on whether you want these tags to work only per section or work both ways, site-wide and per section.
Option A: per section tags
You probably should just use separate taxonomies as @maiki suggests, but then you’d have to override the theme to list on each page the section specific taxonomy rather than the global “tags” taxonomy.
Option B: global and per section tags
the global tags indexes would be generated at /tags as they normally would
as @kaushalmodi suggests, you have to figure out how to, under /jobs/tags and /projects/tags, generate the same kinds of pages generated under /tags, but filtered by section. Not trivial.
change the page templates so that the tags for the page link to the section specific index.
Option C: per section tags (alternate approach)
Treat each section with its own tag space as a separate Hugo site, which you would publish to a subdirectory in your webroot so that the end result would be a single site. You might have to make the right settings in Hugo for that to work (base URL? relative paths?).
Hey, please don’t tag people, especially Bjørn like that. This is a support thread, start a feature topic if you have a request.
Instead of having tags, create a taxonomy called posttags. Then do the same for the other section. Now you have two separate taxonomies. They will have their own lists of content tagged golang: /posttags/golang and /projecttags/golang.