blog/src/posts.njk
2024-10-20 23:32:30 +02:00

32 lines
1.3 KiB
Text

---
layout: postlist.njk
title: Posts
eleventyNavigation:
key: posts
order: 3
pagination:
data: collections.posts
size: 10
alias: blogposts
reverse: true
---
{% for post in blogposts %}
<article class="prose prose-slate mx-auto px-safe-offset-4 md:prose-lg lg:prose-xl xl:prose-2xl dark:prose-invert prose-headings:font-normal prose-strong:text-inherit prose-li:marker:!text-inherit prose-th:font-bold prose-img:rounded-3xl md:px-safe-offset-6">
<h1>{{ post.data.title }}</h1>
<div class="not-prose">
{%- from 'postmeta.macro.njk' import postmeta %}
{{ postmeta({ date: post.date, author: post.data.author, content: post.content, center: false }) }}
</div>
{% if post.data.image and post.data.image.src != '' %}
<img src="{{ post.data.image.src }}" alt="{{ post.data.image.alt }}" sizes="(min-width: 1280px) 960px, (min-width: 1024px) 768px, (min-width: 640px) 640px, 480px">
{% endif %}
<p>{{ post.data.description }}</p>
<a href="{{ post.url }}" class="button inline-flex items-center gap-2 rounded-xl bg-sky-600 px-5 py-2 font-bold text-white no-underline transition-colors duration-300 *:stroke-[2.5] hover:bg-sky-700 xl:rounded-2xl xl:px-6 xl:py-3">
Read on {% lucide "chevron-right", { "class": "size-6 md:size-7 xl:size-8" } %}
</a>
</article>
{% endfor %}