TryGhost/Source

Custom routes.yaml filters ignored

brainandbrain opened this issue · 4 comments

After switching to the new Source theme, the filters I've set up in my custom routes.yaml are no longer filtering posts correctly. Others in the forums also seem to have this issue: https://forum.ghost.org/t/the-source-theme-doesnt-show-posts-on-websites-with-custom-routes/41741/15

I have my routes.yaml set up to hide posts with certain tags from my homepage, which with Source no longer has any filtering. I also found that the collection pages I've set up for specific tags are only filtering up to the lazy load. The next set of posts loaded have no filtering.

EDIT: Now that I'm looking more closely, the lazy load on collection pages is loading the whole feed over again, repeating the posts already loaded.

Narrowed down part of this issue to the feed parameter I was loading on my custom template for those pages, which was set to "index." Changing it to "archive" filtered to the correct posts on collection pages (makes sense).

I've temporarily worked around the main issue (filtering of the home post list) by manually filtering out those tags in post-list.hbs, but I wasn't able to work out why it's ignoring the custom routes.

The problem seems to be the post-list.hbs makes a {{get}} request, instead of looping over the posts already in the route.