Baby steps in using "where"

I’m setting up a robots.txt template and it’s not going well. What’s wrong with this:

User-agent: *
{{ range where .Site.Pages "Params.bookSearchExclude" "true" }}
	Disallow: {{ .RelPermalink }}
{{ end }}

One of the articles has this in the frontmatter: bookSearchExclude: true so shouldn’t it be included ?
for now the output of robots.txt is

User-agent: *

with this exact number of lines.
Using a simple if statement works but I want to improve my syntax…

You are comparing a boolean to a string.

oh, thanks, I forgot. Haven’t paid enough attention to the whole article, sorry. Happy to see that feature is easy to use :slight_smile:

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