Skip to content

Commit

Permalink
Add size check for related posts
Browse files Browse the repository at this point in the history
Fixes #76
  • Loading branch information
mdo committed Apr 3, 2020
1 parent 7c51378 commit b9b13c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ <h1 class="post-title">{{ page.title }}</h1>
{{ content }}
</div>

{% if site.related_posts.size >= 1 %}
<div class="related">
<h2>Related Posts</h2>
<h2>Related posts</h2>
<ul class="related-posts">
{% for post in site.related_posts limit:3 %}
<li>
Expand All @@ -23,3 +24,4 @@ <h3>
{% endfor %}
</ul>
</div>
{% endif %}

0 comments on commit b9b13c7

Please sign in to comment.