1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-23 10:27:20 +01:00
blog/_src/_includes/relatedposts.html

30 lines
864 B
HTML

{% if site.related_posts.size > 1 %}
<aside class="related-posts">
<h1 class="related-posts-title">Related</h1>
<div class="row">
{% for post in site.related_posts %}
{% assign match = false %}
{% for category in post.categories %}
{% if page.categories contains category %}
{% assign match = true %}
{% endif %}
{% endfor %}
{% if match %}
<article class="related-post col2">
<a class="post-title-link" href="{{ post.url }}">
<h1 class="post-title">{{ post.title }}</h1>
</a>
</article>
{% endif %}
{% endfor %}
</div>
</aside>
{% endif %}