master
Zach Leatherman 2020-01-02 21:50:31 -06:00
parent b26e2949c6
commit 38cfa275d2
2 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,4 @@
<ol reversed class="postlist" style="counter-reset: start-from {{ postslist.length + 1 }}">
<ol reversed class="postlist" style="counter-reset: start-from {{ (counterOffset or postslist.length) + 1 }}">
{% for post in postslist | reverse %}
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url | url }}" class="postlist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a>

View File

@ -8,6 +8,7 @@ eleventyNavigation:
<h1>Latest 3 Posts</h1>
{% set postslist = collections.posts | head(-3) %}
{% set counterOffset = collections.posts | length %}
{% include "postslist.njk" %}
<p>More posts can be found in <a href="{{ '/posts/' | url }}">the archive</a>.</p>