mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-22 18:00:06 +01:00
limit related posts to same category, remove from link posts
This commit is contained in:
parent
7d55799afe
commit
f33d52cba3
@ -5,13 +5,22 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
{% for post in site.related_posts limit:6 %}
|
{% for post in site.related_posts %}
|
||||||
|
|
||||||
<article class="related-post col2">
|
{% assign match = false %}
|
||||||
<a class="post-title-link" href="{{ post.url }}">
|
{% for category in post.categories %}
|
||||||
<h1 class="post-title">{{ post.title }}</h1>
|
{% if page.categories contains category %}
|
||||||
</a>
|
{% assign match = true %}
|
||||||
</article>
|
{% 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 %}
|
{% endfor %}
|
||||||
|
|
||||||
|
@ -26,8 +26,6 @@ layout: base
|
|||||||
|
|
||||||
{% include comments.html %}
|
{% include comments.html %}
|
||||||
|
|
||||||
{% include relatedposts.html %}
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
</section>
|
</section>
|
Loading…
Reference in New Issue
Block a user