casper-modified-ghost-theme/partials/post-card.hbs

71 lines
2.8 KiB
Handlebars
Raw Normal View History

2022-01-06 19:23:20 +01:00
<article class="post-card {{post_class}} {{#unless feature_image}}no-image{{else}}{{#is "home"}}{{#has index="nth:6"}}post-card-large{{/has}}{{/is}}{{/unless}}">
{{#if feature_image}}
2022-01-16 17:08:36 +01:00
<a class="post-card-image-link" href="{{url}}" aria-hidden="true">
2022-01-06 19:23:20 +01:00
{{!-- This is a responsive image, it loads different sizes depending on device
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
<img class="post-card-image"
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
sizes="(max-width: 1000px) 400px, 700px"
loading="lazy"
src="{{img_url feature_image size="m"}}"
alt="{{title}}"
/>
</a>
{{/if}}
<div class="post-card-content">
<a class="post-card-content-link" href="{{url}}">
<header class="post-card-header">
{{#if primary_tag}}
{{#primary_tag}}
<div class="post-card-primary-tag">{{name}}</div>
{{/primary_tag}}
{{/if}}
<h2 class="post-card-title">{{title}}</h2>
</header>
<section class="post-card-excerpt">
{{#if feature_image}}
<p>{{excerpt words="30"}}</p>
{{else}}
<p>{{excerpt words="44"}}</p>
{{/if}}
</section>
</a>
<footer class="post-card-meta">
<ul class="author-list">
{{#foreach authors}}
<li class="author-list-item">
2022-01-16 17:08:36 +01:00
<div class="author-name-tooltip" aria-hidden="true">
2022-01-06 19:23:20 +01:00
{{name}}
</div>
{{#if profile_image}}
<a href="{{url}}" class="static-avatar">
<img class="author-profile-image" src="{{img_url profile_image size="xs"}}" alt="{{name}}" />
</a>
{{else}}
<a href="{{url}}" class="static-avatar author-profile-image">{{> "icons/avatar"}}</a>
{{/if}}
</li>
{{/foreach}}
</ul>
<div class="post-card-byline-content">
2023-10-11 12:45:33 +02:00
<span>{{#has author="count:>2"}}Wielu autorów{{else}}{{authors}}{{/has}}</span>
2022-01-16 17:08:36 +01:00
<span class="post-card-byline-date"><time datetime="{{date format="YYYY-MM-DD"}}">{{date format="D MMM YYYY"}}</time> <span class="bull" aria-hidden="true">&bull;</span> {{reading_time}}</span>
2022-01-06 19:23:20 +01:00
</div>
</footer>
</div>{{!--/.post-card-content--}}
</article>