Convert blog posts page to Vento

This commit is contained in:
Leilukin 2025-05-04 20:30:07 +08:00
parent fbf8f5df73
commit 379e0d0854

View File

@ -3,29 +3,29 @@ title: Blog Archive
layout: main/content
tags: blog pages
eleventyComputed:
desc: Archive of blog posts on {{ sitemeta.siteName | safe }}
desc: Archive of blog posts on {{ sitemeta.siteName }}
eleventyNavigation:
key: Blog Archive
parent: Blog
---
<ul class="blog__postlist">
{% for post in collections.posts | reverse %}
{{ for post of collections.posts |> toReversed }}
<li class="blog__postlist--item">
<h2 class="blog__postlist--title">
<a href="{{ post.url }}">
{% if post.data.title %}{{ post.data.articleTitle }}
{% else %}
{{ if post.data.title }}{{ post.data.articleTitle }}
{{ else }}
<code>{{ post.url }}</code>
{% endif %}
{{ /if }}
</a>
</h2>
<time datetime="{{ post.date }}">{{ post.date | formatDate }}</time>
<time datetime="{{ post.date }}">{{ post.date |> formatDate }}</time>
</li>
{% endfor %}
{{ /for }}
</ul>
{%- css %}
{{- css }}
.blog__postlist {
display: grid;
gap: 1em;
@ -37,4 +37,4 @@ eleventyNavigation:
line-height: 1.3;
margin-bottom: 0.2em;
}
{% endcss %}
{{ /css }}