Show links to related posts

Enter note titles in `page.related` and add `use: [notes]` to include
links to related notes.
This commit is contained in:
Oliver Davies 2024-09-14 13:58:24 +01:00
parent b8c90e893c
commit 5baae90010

View file

@ -32,4 +32,18 @@
{% endfor %}
</ul>
{% endif %}
{% if page.related and data.notes %}
<section>
<h2>Related</h2>
<ul>
{% for note in data.notes if page.related|filter((title) => title == note.title) %}
<li>
<a href="{{ note.url|trim('/', 'right') }}">{{ note.title }}</a>
</li>
{% endfor %}
</ul>
</section>
{% endif %}
{% endblock %}