I want to list only a specific tag on a page

I want only one tag to be listed on a specific page.

For example, I have 50 articles and some articles have the tag “hugo”.

I want to list only the articles with this “hugo” tag on a page with code.

When I enter tags/hugo/ as URL, what I want comes out, but I need to write code because I want to use it on another page.

I couldn’t find anything in the documentation about this code.

Can you help me?

{{ range where site.RegularPages "Params.tags" "intersect" (slice "foo") }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}

https://gohugo.io/functions/where/#use-where-with-intersect

4 Likes

Thank you. :smiling_face_with_three_hearts:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.