Show related-tag posts in "read more" section

Thanks to the new tutorial released by Ghost:

    https://ghost.org/tutorials/read-next/
This commit is contained in:
Badri Sunderarajan 2023-03-14 19:20:36 +05:30
parent 92938d0c49
commit 735508cdec
2 changed files with 7 additions and 4 deletions

View file

@ -2,7 +2,7 @@
"name": "weflock", "name": "weflock",
"description": "Snipette theme with Analog vibes, derived from Casper", "description": "Snipette theme with Analog vibes, derived from Casper",
"demo": "https://snipettemag.com", "demo": "https://snipettemag.com",
"version": "1.2.0", "version": "1.2.1",
"engines": { "engines": {
"ghost": ">=4.0.0" "ghost": ">=4.0.0"
}, },

View file

@ -100,8 +100,12 @@ into the {body} tag of the default.hbs template --}}
</div> </div>
</section> </section>
{{/unless}} {{/unless}}
{{/post}}
{{!-- I don't know why we had to have this block outside the
"post" block, but that's the way the cookie crumbled. --}}
{{#is "post"}}
{{!-- Read more links, just above the footer --}} {{!-- Read more links, just above the footer --}}
<aside class="read-more-wrap"> <aside class="read-more-wrap">
<div class="read-more inner"> <div class="read-more inner">
@ -112,7 +116,7 @@ into the {body} tag of the default.hbs template --}}
This query gets the latest 3 posts on the site, but adds a filter to This query gets the latest 3 posts on the site, but adds a filter to
exclude the post we're currently on from being included. --}} exclude the post we're currently on from being included. --}}
{{#get "posts" filter="id:-{{id}}" include="authors" limit="3" as |more_posts|}} {{#get "posts" filter="tags:[{{post.tags}}]+id:-{{post.id}}" include="authors" limit="3" as |more_posts|}}
{{#if more_posts}} {{#if more_posts}}
{{#foreach more_posts}} {{#foreach more_posts}}
{{> "post-card"}} {{> "post-card"}}
@ -122,5 +126,4 @@ into the {body} tag of the default.hbs template --}}
</div> </div>
</aside> </aside>
{{/is}}
{{/post}}