Use the same template for taglists and the blog index. Move the tagposts into a collection to make life easier
Build and copy to prod / build-and-copy (push) Successful in 2m7s

This commit is contained in:
Lewis Dale committed 2024-04-12 10:15:25 +01:00
1 parent 2a900ce835
commit d209f82688
7 files changed
+71 -58

No files matched your search

+8 -28
View File
@@ -1,38 +1,18 @@
---
title: Blog
title: Blog posts
layout: base.njk
pagination:
data: collections.posts
size: 5
reverse: true
alias: posts
eleventyImport:
collections: ["posts"]
feeds:
rss: "/rss.xml"
atom: "/atom.xml"
json: "/feed.json"
---
<main class="wrapper-lg stack-xl">
<h1>Blog posts</h1>
{% extends "components/blog.njk" %}
<aside class="inverse text-center">
<p>
Subscribe via <a href="/rss.xml">RSS</a>, <a href="/atom.xml">Atom</a>, or <a href="/feed.json">JSON</a>.
</p>
</aside>
<ol class="stack-xl" role='list'>
{% for item in pagination.items %}
<li class="stack-xs">
<h2><a href="{{ item.url }}">{{ item.data.title | safe }}</a></h2>
<time class="block" datetime="{{ item.date | dateToRfc3339 }}">{{ item.date | dateDisplay }}</time>
<p class="e-content p-summary">{{ item.content | excerpt }}</p>
<a href="{{ item.url }}" class="inline-block">Read more</a>
</li>
{% endfor %}
</ol>
<nav class="blog-nav row" data-spacing="between" aria-label="View more posts">
{% if pagination.href.next %}
<a href="{{ pagination.href.next }}">Older</a>
{% endif %}
{% if pagination.href.previous %}
<a href="{{ pagination.href.previous }}">Newer</a>
{% endif %}
</nav>
</main>
{{ content | safe }}