Re-opening this because i have another need. I am trying to figure out how to remove certain posts from the homepage (first and foremost).
If i use the tag #hidden the post is completely hidden, but i want it viewable still just not listed on the homepage.
I am using the ruby theme (https://ruby.ghost.io/). The problem I am running into now is, i could add this filter to the right #get statement but unfortunately I can not find a get statement related to the homepage content. Only #foreach nested inside .hbs files. Does anyone with knowledge of the Ruby theme know which .hbs file I should modify to affect the homepage loop? I cant seem to find the context for the homepage anywhere and where that is set so I can add the filter to it.
I tried wrapping the foreach statement in a get statement but now the context of my pages is screwed up. If I click the top navigation buttons on my site which link to a page with the corresponding tag. For example: vehicles link would list all posts with the vehicles tag. Now it lists ALL posts (minus the #hide tag). This is the get statement I used, i suppose i should remove limit=all?
I’m not really sure how to use that information to do this.
The issue is, if i add a get around the #foreach inside list.hbs then it changes the context for all pages using list.hbs to ALL tags. What i dont understand, is where the tag context comes from on subpages of my site that link to /tags/xxx/ How do those pages, which I think also use index.hbs, know to get only posts with that current page’s tag?
Another idea is, i could add a conditional, since really i only want to remove posts with the #hide tag from the homepage, they can stay on the sub-pages (tag pages).
so if i were to say something like:
#if current page is domain.com/ (root), then get + filter -#hide tag, else use the normal foreach statement (without the get statement).
In this case I think I would need to do two foreach statements as well, one with the get and one without the get based on the condition.
... output something special for the home page ...
... output something different on all other pages ...
Or you could use the routing configuration to point the system to a dedicated template for the home page, and some other template for everything else. It is also possible to set filters on the routing level, instead of inn the get statements.
Awesome, thanks! Second option sounds maybe slightly better, but first option i think is closer to my abilities. I would like to learn more about how routing and custom templates work int he future though so will read about it, but for the sake of ease i will use the first suggestion. Thank you!