Skip to content

Custom routes.yaml filters ignored #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brainandbrain opened this issue Dec 8, 2023 · 9 comments
Closed

Custom routes.yaml filters ignored #33

brainandbrain opened this issue Dec 8, 2023 · 9 comments

Comments

@brainandbrain
Copy link

brainandbrain commented Dec 8, 2023

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
Copy link
Author

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 brainandbrain reopened this Dec 14, 2023
@cathysarisky
Copy link
Member

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

@cowchimp
Copy link

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

@augusto-romero-arango
Copy link

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.
SincosoftSAS@9f7a54b?diff=split&w=0

@davidfraser
Copy link

This should be solved by #72

@cowchimp
Copy link

cowchimp commented Feb 1, 2025

@minimaluminium maybe you can take a look please?
this bug makes routes.yaml not work as it's documented in the default theme.

@minimaluminium
Copy link
Member

Hello everyone,

Source offers some advanced layout options and we had to come up with some get query tricks to accomplish this. Unfortunately, the get query doesn’t respect the custom routes. We had to sacrifice the ease for those who are using custom routing with the assumption that they’re comfortable enough to edit the theme code to get it working on their end.

If you're using custom routing, we recommend modifying your theme's code directly to apply your custom routing filter to the Source theme for proper functionality.

@decathorpe
Copy link

That's really unfortunate for users of the "Starter" subscription, though - you can set custom routes, but not use Custom themes. So having this functionality be broken in the default theme out of the box means it's not usable on the "Starter" plan ...

@davidfraser
Copy link

I'm not sure why this was closed when I thought my pull request was a fairly simple, valid way of solving this in general... Was there a problem with it that I couldn't see? At minimum it would be helpful for the Source theme to document that it doesn't fully support custom routes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants