Hi all, probably a super basic question but I’m not a developer
I’m trying to use tags to group posts and I’ve edited the routes.yaml as below. Now when I click on each of two links below, I can see an archive list of all the posts with the correct filter tag BUT ALSO all the other posts which should have been filtered out – what am I missing?
Thank you
routes:
/series/homestretch/:
controller: channel
template: index
filter: tag:home-stretch
/exercises/:
controller: channel
template: index
filter: tag: exercise
The routes file is whitespace sensitive, which means that the formatting (spacing) needs to be exact for routing to work. Check this doc and make sure your whitespace matches (using a code editor like VS Code can help):
Hi Ryan – thank you very much for your response. The code I pasted in my original post wasn’t showing the indents because of the forum formatting, but I did inclulde whitespace in the actual yaml file (please see screenshot below).
After the routes are applied, the total number of articles archived under each tag is correct, but the page will display a list of everything under the “Latest” heading, including articles tagged under other categories.
Hope this makes sense – I’m not including a link to my site 'cause it’s still under construction, but let me know if it’s easier to just paste it here.
Thanks for following up! Formatting was the easiest solution, but it seems like you’ve got that handled.
I think the culprit here is the index page for the Digest theme. It uses a get helper, which exempts it from the custom routing you set up. You’ll either have to modify the index page to not use/modify the get helper, create a custom template, or choose a different theme.