add related posts and update some styling

This commit is contained in:
2026-02-20 08:36:46 -08:00
parent c4b549bc75
commit 7d1fe776c7
7 changed files with 73 additions and 19 deletions

View File

@ -3,6 +3,7 @@ layout: base.njk
---
{% css %}{% include "css/post.css" %}{% endcss %}
{% css %}{% include "css/highlighting.css" %}{% endcss %}
{% css %}{% include "css/lists.css" %}{% endcss %}
{% js %}{% include "node_modules/@zachleat/heading-anchors/heading-anchors.js" %}{% endjs %}
<heading-anchors content="<i class='fa-solid fa-anchor'></i>">
@ -43,4 +44,16 @@ layout: base.njk
{% set newerTitle = newerPost.data.title %}
{% set inPost = true %}
{% include "pagination.njk" %}
<hr>
{% set relevantTags = tags | removeBasicTags %}
{% set postlist = collections.posts | filterByTags(relevantTags) | excludeFromCollection([page.url, olderHref, newerHref]) | randomize | head(3) %}
{% if postlist.length %}
<section class="related-posts">
<h2>related posts</h2>
{% include "postlist.njk" %}
</section>
{% endif %}
</heading-anchors>