refactor: ♻️ move post meta into importable macro

This commit is contained in:
Sebin Nyshkim 2024-10-15 22:56:22 +02:00
parent 9f7387c54b
commit 1ebb0e7226
3 changed files with 22 additions and 32 deletions

View file

@ -15,22 +15,8 @@ pagination:
<article class="prose prose-slate mx-auto md:prose-lg lg:prose-xl dark:prose-invert prose-headings:font-normal prose-strong:text-inherit prose-li:marker:!text-inherit prose-th:font-bold prose-img:rounded-3xl">
<h1>{{ post.data.title }}</h1>
<aside class="not-prose space-y-4 text-base">
<ul class="flex flex-wrap items-center gap-4 *:inline-flex *:items-center *:gap-1 *:*:stroke-sky-600">
<li>
{% lucide "calendar", {"size": "20"} %}
<time datetime="{{ post.date | isoDate }}" title="{{ post.date | longDate }}">
{{ post.date | readableDate }}
</time>
</li>
<li>
{% lucide "user", {"size": "20"} %}
<a href="{{ post.data.author.href }}">{{ post.data.author.name }}</a>
</li>
<li>
{% lucide "glasses", {"size": "20"} %}
{{ post.content | readingtime }}
</li>
</ul>
{%- from 'postmeta.macro.njk' import postmeta %}
{{ postmeta({ date: post.date, author: post.data.author, content: post.content}) }}
</aside>
{% if post.data.image and post.data.image.src != '' %}