I am using the dawn theme and customised a few elements for my needs. I am using three main tags on my website: work, blog, and about-me. On home I need to exclude the tag blog for the post list. I tried with the code below and it’s partially working. It’s excluding the tag blog but at the same time it’s shower fewer articles for every blog entry with the tag blog. So what can I do to always show a fixed amount of posts?
You could do that with the routes.yaml file, with the filter option.
Then in your index you don’t have to check as all posts with blog should be excluded.
The “/” collection should look something like this:
collections:
/:
permalink: /{slug}/
template: index
filter: tag:-[blog]
This works perfectly. Thank you bironthemes! I am wondering about one thing. I fiddled around with the routes.yaml which is placed in my theme root. And it had no effect at all. But I discovered there is another routes.yaml in content/setttings and that worked. Does the routes.yaml within the theme root have no meaning at all?
No, the routes files in the theme root is usually for tracking the changes of that file.
Whenever you change it you have to upload it in the Admin/Settings.