michalvankodev-site/axum_server/templates/components/blog_post_preview.html

27 lines
983 B
HTML

<article class="grid grid-cols-[max-content_1fr] grid-flow-col gap-4">
<aside class="row-span-3">
{% match post.metadata.thumbnail %}
{% when Some with (orig_path) %}
{{ crate::picture_generator::picture_markup_generator::generate_picture_markup(orig_path, 180, 240, "Article thumbnail").unwrap()|safe }}
{% when None %}
<div> TODO default obrazok </div>
{% endmatch %}
</aside>
<header>
<h3 class="text-lg font-bold mb-1">{{post.metadata.title}}</h3>
</header>
<section class="text-base leading-5 text-gray-800">{{post.body|description_filter|safe}}</section>
<footer class="text-sm">
<ul class="inline-block">
{% for tag in post.metadata.tags %}
<li class="inline-block">
<a href="/blog/tags/{{tag}}" class="text-pink-950 no-underline">#{{tag|capitalize}}</a>
</li>
{% endfor %}
</ul>
|
<time datetime="{{post.metadata.date}}" class="text-pink-950"> {{post.metadata.date|pretty_date}} </time>
</footer>
</article>