Exclude content based on tag

#1

Is it possible to exclude topics based on custom tags in the front matter? I know you can exclude draft topics but I’m looking to have different config files, each of which publishes a subset of the content.

I’ve scoured the documentation but I may have missed something.

#2

Try:

{{ range .Pages }}
  {{ if not (in .Params.tags "some-tag") }}
    ...
  {{ end }}
{{ end }}
#3

Thanks for helping out, @zwbetz. Where would I put that script? I’m guessing not in a config file…

#4

That goes in your template. Then you could have logic that runs different template code depending on some flag in your config file, etc.

#5

Ah, got it. I think I can make that work. Many thanks!