Skip to content

Commit

Permalink
Merge pull request #242 from poole/related-post-size
Browse files Browse the repository at this point in the history
Add size check for related posts
  • Loading branch information
mdo authored Apr 3, 2020
2 parents 7c51378 + b9b13c7 commit e637093
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 e637093

Please sign in to comment.