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:
parent
92938d0c49
commit
735508cdec
2 changed files with 7 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
|||
"name": "weflock",
|
||||
"description": "Snipette theme with Analog vibes, derived from Casper",
|
||||
"demo": "https://snipettemag.com",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"engines": {
|
||||
"ghost": ">=4.0.0"
|
||||
},
|
||||
|
|
9
post.hbs
9
post.hbs
|
@ -100,8 +100,12 @@ into the {body} tag of the default.hbs template --}}
|
|||
</div>
|
||||
</section>
|
||||
{{/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 --}}
|
||||
<aside class="read-more-wrap">
|
||||
<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
|
||||
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}}
|
||||
{{#foreach more_posts}}
|
||||
{{> "post-card"}}
|
||||
|
@ -122,5 +126,4 @@ into the {body} tag of the default.hbs template --}}
|
|||
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
{{/post}}
|
||||
{{/is}}
|
Loading…
Reference in a new issue