I write a blog each time I travel in my campervan and use tags to separate the different trips into separate pages on my Ghost blog.
Ideally I would like the Home page to be a standard blog page, all the posts with the latest entry at the top. But for each of the completed trips I want a separate blog page based on the trip’s primary_tag (easy - I do this already) but with the posts in reverse order so the trip is a sequential story as opposed to blog. One way to achieve this seems to be to edit my tag.hbs file and ignore the tag list provided by the ghost engine and re-get all the tags in inverse order using:
{{!-- The main content area --}}
<main id="site-main" class="site-main outer" role="main">
<div class="inner">
{{#get "posts" filter="primary_tag:trip1" order="published_at asc" }}
<div class="post-feed">
<!-- `posts` from the parent context is overwritten by get -->
{{#foreach posts}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
</div>
{{/get}}
</div>
</main>
This works fine provided I hard code the primary_tag name in the filter. However I want to use this for several different pages with different primary_tags. An obvious solution would be to find the context of the primary_tag when in tag.hbs . I had hoped something simple like filter=“primary_tag:{{primary_tag}}” might work.
An alternative - I read somewhere that I can have tag-trip1.hbs, tag-trip2.hbs etc and the page http://myblog/tag/trip1 would use up the appropriate hbs file - this is not optimal as I would need multiple tag.hbs files differing by just the primary_tag filter, but would work. Only problem is, when I tried it the page seemed to use the generic tag.hbs not the specific tag-trip1.hbs
Any thoughts on how to achieve this without playing around inside the engine code?