mind-overflow-website-ghost.../partials/post-card-small.hbs

26 lines
1.1 KiB
Handlebars
Raw Normal View History

{{!-- Gest the 3 most recent related posts --}}
{{#get "posts" limit="3" filter="id:-{{post.id}}+tags:[{{post.tags}}]" include="tags" as |related|}}
2020-11-04 23:47:36 +01:00
<h4>Similar posts</h4>
{{#foreach related}}
<article class="{{post_class}}">
<a class="mind-post-card-sidebar_main" href="{{url}}">
2020-11-04 23:43:30 +01:00
2020-11-04 23:47:36 +01:00
{{#if feature_image}}
<img class="mind-post-card-sidebar_feature-image" src="{{img_url feature_image size="s"}}"
alt="Feature Image"/>
{{/if}}
<header class="mind-post-card-sidebar_header">
<p class="mind-post-card-sidebar_meta"><span
class="mind-post-card-sidebar_tag">{{primary_tag.name}}</span> •
<time class="post-date" datetime="{{date published_at format='YYYY-MM-DD'}}">{{date
published_at format="DD MMMM YYYY"}}</time>
2020-11-04 23:47:36 +01:00
</p>
<h5>{{title}}</h5>
</header>
</a>
</article>
{{/foreach}}
{{else}}
2020-11-04 23:47:36 +01:00
<h4>No related posts</h4>
{{/get}}