Skip to content

Instantly share code, notes, and snippets.

@ylv-io
Created May 18, 2018 18:50
Show Gist options
  • Save ylv-io/8e412de70492e1aef5861282ee8f5f12 to your computer and use it in GitHub Desktop.
Save ylv-io/8e412de70492e1aef5861282ee8f5f12 to your computer and use it in GitHub Desktop.
{{!-- Related posts --}}
{{#get "posts" filter="tags:[{{tags[*].slug}}]+id:-{{id}}" limit="3" include="tags" as |related_posts|}}
{{#foreach related_posts}}
{{#if @first}}
<section class="read-next inner">
<h2 class="read-next-title">Read Next</h2>
{{/if}}
<article class="{{post_class}}">
<header class="post-header">
<div class="post-meta">
<time class="published" datetime="{{date format='YYYY-MM-DD'}}">{{date format="MMMM DD, YYYY"}}</time>
· {{reading_time}}
</div><!-- .post-meta -->
<h3 class="post-title"><a href="{{{url}}}" rel="bookmark">{{title}}</a></h3>
{{#if tags}}
<p class="post-tags">{{tags separator=" "}}</p>
{{/if}}
</header><!-- .post-header -->
{{#if feature_image}}
<a href="{{url}}" class="post-thumbnail"><img src="{{feature_image}}" alt="{{title}}" /></a>
{{/if}}
</article><!-- .post -->
{{#if @last}}
</section><!-- .read-next -->
{{/if}}
{{/foreach}}
{{/get}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment