add related posts and update some styling
This commit is contained in:
@ -41,8 +41,6 @@
|
||||
|
||||
<main id="main">
|
||||
{{ content | safe }}
|
||||
|
||||
<hr>
|
||||
</main>
|
||||
|
||||
{% include "footer.njk" %}
|
||||
|
||||
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user