Hi, everyone. I’m looking for a strategy for filtering out posts from my home page list. I converted a site from Drupal over to HUGO and used the “promote to front page” flag to keep some posts from appearing on the front of my site.
I was thinking that I could create some type of status flag and for some posts would have that set to “not promoted” or something. I’m not sure I understand what the best approach would be for doing this.
I’ve tried creating a taxonomy using this in frontmatter:
promo = ["no"]
I’m finding it hard to figure out how to properly filter them out from my index listing. Is there a way to use a where statement that generates a list while filtering out results matching a term from a taxonomy? Or maybe someone has had a similar use case and has a better approach that they can suggest?
Thanks, guys. I think I got what I need. Am just checking for {{ if not (isset .Params “nopromo” ) }} and that’s working fine although this is how I did it:
{{ range first 10 .Site.Recent }}
{{ if not (isset .Params "nopromo" ) }}
{{ .Render "list-node"}}
{{ end }}
{{ end }}
It’s not ideal, because what I wanted was to show latest 10 posts, but I end up just subtracting any of those posts that have the nopromo param.