1
0
mirror of https://github.com/Damillora/Yuika synced 2024-11-16 14:57:32 +00:00
Yuika/partials/post-card.hbs

66 lines
2.0 KiB
Handlebars

<article class="post-card">
<a href="{{url}}">
{{> post-background}} {{!--Special header-image.hbs partial to generate the background image--}}
</a>
<div class="post-card__info">
<div class="post-card__tag-row">
{{#if primary_tag}}
{{#primary_tag}}
<a class="post-card__tag-info" href="{{url}}">
<span class="post-card__tag-name">{{name}}</span>
{{#if accent_color}}
<span class="post-card__tag-color" style="background-color: {{accent_color}};"></span>
{{else}}
<span class="post-card__tag-color"></span>
{{/if}}
</a>
{{/primary_tag}}
{{/if}}
{{#has visibility="paid"}}
<a class="post-card__tag-info" href="/subscribe">
<span class="post-card__paywall">Paid content</span>
</a>
{{/has}}
{{#has visibility="members"}}
<a class="post-card__tag-info" href="/subscribe">
<span class="post-card__paywall">Member-exclusive</span>
</a>
{{/has}}
</div>
<a href="{{url}}">
<h1 class="post-card__title">{{title}}</h1>
</a>
<p class="post-card__time">
<span>
<time datetime="{{date format=" YYYY-MM-DD"}}">
{{date format="D MMM YYYY"}}
</time>
<span class="bull">&bull;</span>
{{reading_time}}
</span>
</p>
{{#if authors}}
<div class="post-card__author-list">
<div class="post-card__author-images">
{{#foreach authors}}
{{#if profile_image}}
<a href="{{url}}">
<img class="post-card__author-image" src="{{img_url profile_image size="xs"}}" alt="{{name}}" />
</a>
{{/if}}
{{/foreach}}
</div>
<div class="post-card__author-names">
{{#has author="count:>2"}}Multiple authors{{else}}
{{#foreach authors}}
<a href="{{url}}" title="{{name}}" class="post-card__author-name">{{name}}</a>
{{/foreach}}
{{/has}}
</div>
</div>
{{/if}}
<div class="post-card__excerpt">
<p>{{excerpt words="30"}}</p>
</div>
</div>
</article>