Hello. I am using filter in my routes.yaml file like so
collections:
/blog/:
permalink: /blog/{slug}/
template: blog
filter: 'tag:-hash-gallery'
I don’t want any posts with #gallery tag to show on my blog page. However, these #gallery posts are still available in Search results and when a user clicks that search result there is 404 Error. How do I filter my collection without populating my search box full of errors?
SOLUTION: Provide a second collection for the search results to bind to
collections:
/blog/:
permalink: /blog/{slug}/
template: blog
filter: 'tag:-hash-gallery'
/gallery/:
permalink: /gallery/{slug}/
template: blog
filter: 'tag:hash-gallery'