ghost-theme-sd.ai/partials/post-card.hbs

37 lines
1.9 KiB
Handlebars
Raw Normal View History

2023-08-14 02:10:22 +01:00
<article class="gh-card {{post_class}}{{#unless @custom.show_images_in_feed}} no-image{{/unless}}">
2023-07-10 04:14:43 +01:00
<a class="gh-card-link" href="{{url}}">
{{#if feature_image}}
<figure class="gh-card-image">
<img
2023-09-19 14:19:25 +01:00
srcset="{{img_url feature_image size="xs" format="webp"}} 160w,
{{img_url feature_image size="s" format="webp"}} 320w,
{{img_url feature_image size="m" format="webp"}} 600w,
{{img_url feature_image size="l" format="webp"}} 960w,
{{img_url feature_image size="xl" format="webp"}} 1200w,
{{img_url feature_image size="xxl" format="webp"}} 2000w"
sizes="{{#if imageSizes}}{{imageSizes}}{{else}}320px{{/if}}"
2023-07-10 04:14:43 +01:00
src="{{img_url feature_image size="m"}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
2023-09-19 14:19:25 +01:00
{{#if lazyLoad}}loading="lazy"{{/if}}
2023-07-10 04:14:43 +01:00
>
</figure>
{{/if}}
<div class="gh-card-wrapper">
2023-07-11 10:55:58 +01:00
{{#if primary_tag}}
<p class="gh-card-tag">{{primary_tag.name}}</p>
{{/if}}
<h3 class="gh-card-title is-title">{{title}}</h3>
2023-07-31 05:58:56 +01:00
{{#if excerpt}}
<p class="gh-card-excerpt is-body">{{excerpt}}</p>
{{/if}}
<footer class="gh-card-meta"><!--
2023-07-11 10:55:58 +01:00
-->{{#if @custom.show_author}}
2023-07-10 07:03:07 +01:00
<span class="gh-card-author">By {{#foreach authors}}{{#if @first}}{{name}}{{else}}, {{name}}{{/if}}{{/foreach}}</span>
{{/if}}
2023-08-24 13:26:18 +01:00
{{#if @custom.show_publish_date}}
2023-07-10 07:03:07 +01:00
<time class="gh-card-date" datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time>
2023-07-11 10:55:58 +01:00
{{/if}}<!--
--></footer>
2023-07-10 04:14:43 +01:00
</div>
</a>
</article>