Source icon indicating copy to clipboard operation
Source copied to clipboard

Custom routes.yaml filters ignored

Open brainandbrain opened this issue 1 year ago • 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.

brainandbrain avatar Dec 08 '23 15:12 brainandbrain

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.

brainandbrain avatar Dec 14 '23 23:12 brainandbrain

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

cathysarisky avatar Feb 13 '24 01:02 cathysarisky

Anyone able to tackle this? I would be happy to offer a "bounty".

cowchimp avatar Aug 10 '24 05:08 cowchimp

Anyone able to tackle this? I would be happy to offer a "bounty".

In post-list.hbs insted the get sections use foreach.

Look how I solved it. https://github.com/SincosoftSAS/Bitakora.GhostSourceTheme/commit/9f7a54b0bdc2a33b9fca77b9eafd94769d32137f?diff=split&w=0

augusto-romero-arango avatar Aug 10 '24 15:08 augusto-romero-arango