Intersect Function

Hi ,

I have an Array of Topics which I configure in my config.toml at Site level and I only want to display those topic pages as I am iterating through my .Site.Pages

Is this a good use case to use the intersect function

config.toml

Topics: = [“current”,“sports”,“fashion”]

And in the index.md, page1.md, page2.md , I have various tags
Tags = [“current”, “sports”]

I want to only show the pages which have either of current, sports and fashion

Thanks, Rajesh

This sounds like a known issue. Should be fixed in the next release.

https://github.com/spf13/hugo/issues/1952

1 Like