Skip to content

Instantly share code, notes, and snippets.

@ejamesc
Created September 11, 2018 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ejamesc/7a88f4ec2cee41a87bb95886546c41af to your computer and use it in GitHub Desktop.
Save ejamesc/7a88f4ec2cee41a87bb95886546c41af to your computer and use it in GitHub Desktop.
{{!-- CHANGE this filter to filter for the category you'd like --}}
{{#get "posts" filter="tag:[books]" limit="4" as |books|}}
{{#if books}}
<div class='row'>
<div class='small-12 columns'>
{{!-- CHANGE this url to "/tag/<tagname>" to link to the tag addres --}}
<h2 class='home__books-section-heading'><a class="home__books-section-heading__a" href="{{@blog.url}}/tag/books">{{t "Book Summaries"}}</a></h2>
</div>
</div>
<div class='row home__books'>
{{#foreach books}}
<div class='small-12 medium-6 large-3 {{#if @last}}end{{/if}} columns'>
<a href='{{url}}'><img class="home__books-img" src="{{img_url feature_image}}" alt="{{t "Feature image for"}} {{title}}"/></a>
<h3 class="home__books-header"><a class="home__books-link" href="{{url}}">{{{title}}}</a></h3>
<p class="home__books-excerpt">{{excerpt words="20"}}{{#unless custom_excerpt}}&hellip;{{/unless}}</p>
</div>
{{/foreach}}
</div>
{{/if}}
{{/get}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment