Files
Blog/_includes/postslist.njk
2024-11-11 21:36:33 +00:00

30 lines
1.0 KiB
Plaintext

{%- css %}.postlist { counter-reset: start-from {{ (postslistCounter or postslist.length) + 1 }} }{% endcss %}
<ul reversed class="postlist">
{% for post in postslist | reverse %}
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url }}" class="postlist-link">
{% if post.data.title %}
{{ post.data.title }}
{% else %}
<code>{{ post.url }}</code>
{% endif %}
</a>
<span class="postlist-byline">
<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate }}</time>
<ul class="postlist-tags">
{%- for tag in post.data.tags | filterTagList %}
{%- set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<li>
<a href="{{ tagUrl }}" class="postlist-tag">{{ tag }}</a>
{%- if not loop.last %}, {% endif %}
</li>
{%- endfor %}
</ul>
</span>
{{ post.data.page.excerpt | md | safe }}
<a href="{{ post.url }}" class="postlist-read-more">
Read more
</a>
</li>
{% endfor %}
</ul>