lewisdale.dev/src/blog/tag.html
2023-12-30 20:10:07 +00:00

42 lines
1.2 KiB
HTML

---json
{
"title": "Blog",
"layout": "base.njk",
"pagination": {
"data": "collections.tags",
"size": 1,
"alias": "tag"
},
"eleventyComputed": {
"permalink": "/post/tag/{{ tag }}/",
"feed": {
"rss": "{{ page.url }}rss.xml",
"atom": "{{ page.url }}atom.xml",
"json": "{{ page.url }}feed.json"
}
}
}
---
<main class="wrapper-md stack-lg">
<h1>Posts tagged “{{ tag }}”</h1>
<aside class="text-center">
<p>
Subscribe via <a href="{{ feed.rss }}">RSS</a>, <a href="{{ feed.atom }}">Atom</a>, or <a href="{{ feed.json }}">JSON</a>.
</p>
</aside>
<ol class="stack-xl" role='list'>
{% set posts = collections.posts | filterBy(tag) | reverse %}
{% for item in posts %}
<li class="stack-xs">
<h2><a href="{{ item.url }}">{{ item.data.title | safe }}</a></h2>
<time datetime="{{ item.date | dateToRfc3339 }}" class="block">{{ item.date | dateDisplay }}</time>
<div class="e-content p-summary">{{ item.content | excerpt }}</div>
<a href="{{ item.url }}" class="inline-block">Read more</a>
</li>
{% endfor %}
</ol>
</main>