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

26 lines
1.1 KiB
Handlebars

{{!-- Gest the 3 most recent related posts --}}
{{#get "posts" limit="3" filter="id:-{{post.id}}+tags:[{{post.tags}}]" include="tags" as |related|}}
<h4>Similar posts</h4>
{{#foreach related}}
<article class="{{post_class}}">
<a class="mind-post-card-sidebar_main" href="{{url}}">
{{#if feature_image}}
<img class="mind-post-card-sidebar_feature-image" src="{{img_url feature_image size="s"}}"
alt="{{title}}"/>
{{/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>
</p>
<h5>{{title}}</h5>
</header>
</a>
</article>
{{/foreach}}
{{else}}
<h4>No related posts</h4>
{{/get}}