liebling/partials/loop.hbs

57 lines
2.1 KiB
Handlebars
Raw Normal View History

2019-04-14 18:41:25 +00:00
{{!-- The template below includes the markup for each post --}}
2019-02-24 21:06:24 +00:00
{{#foreach posts}}
2019-03-03 18:32:36 +00:00
{{#is "post"}}
<div class="m-recommended-slider__item">
2019-03-03 18:32:36 +00:00
{{/is}}
2019-02-24 21:06:24 +00:00
{{#if feature_image}}
<article class="m-article-card {{post_class}}">
<div class="m-article-card__picture" style="background-image: url({{feature_image}});">
{{else}}
<article class="m-article-card no-picture {{post_class}}">
<div class="m-article-card__picture">
{{/if}}
<a href="{{url}}" class="m-article-card__picture-link" aria-label="Article"></a>
<a href="{{primary_author.url}}" class="m-article-card__author js-tooltip" aria-label="Authors" data-tippy-content="Posted by {{primary_author.name}} {{authors autolink="false" from="2" prefix="<br>Among with " separator=" , "}}">
2019-02-24 21:06:24 +00:00
{{#if primary_author.profile_image}}
<div style="background-image: url({{primary_author.profile_image}});"></div>
{{else}}
<div style="background-image: url({{asset "images/default-avatar-square-small.jpg"}});"></div>
{{/if}}
</a>
{{#if featured}}
<a href="{{url}}" class="m-article-card__featured js-tooltip" data-tippy-content="Featured" aria-label="Article">
<span class="icon-star"></span>
</a>
{{/if}}
</div>
{{#if primary_tag}}
<div class="m-article-card__info">
<a href="{{primary_tag.url}}" class="m-article-card__tag">{{primary_tag.name}}</a>
{{else}}
<div class="m-article-card__info no-tag">
{{/if}}
<a href="{{url}}" class="m-article-card__info-link">
<div>
<h2 class="m-article-card__title">{{title}}</h2>
</div>
<div class="m-article-card__timestamp">
<span>{{date published_at timeago="true"}}</span>
2019-02-24 21:06:24 +00:00
<span>&bull;</span>
<span>{{reading_time}}</span>
</div>
</a>
</div>
</article>
2019-03-03 18:32:36 +00:00
{{#is "post"}}
</div>
2019-03-03 18:32:36 +00:00
{{/is}}
2019-02-24 21:06:24 +00:00
{{else}}
<header class="m-heading no-margin">
2019-02-24 21:06:24 +00:00
<h3>No posts found</h3>
<p>
Apparently there are no posts at the moment, check again later.
</p>
</header>
{{/foreach}}