J_B
1
Hi,
I’m still learning Hugo and I’m trying to build my first theme. On my index page, I’m trying to do the following but I’m having trouble:
- List pages that have certain categories (or tags) attributed to them in the page’s frontmatter
or
- list pages that are in sections that I have identified in a mainSections: param in the config.
Something is tripping me up and I cannot get it to work.
And ideas?
I don’t have a public repo yet.
Arif
2
That’s not helping. Anyway, from my own guesswork
- Maybe try intersect
{{ $pages := where .Site.RegularPages "Params.categories" "intersect" (slice "category1" "category2") }}
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
[params]
mainSections = ["section1","section2"]
system
Closed
4
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.