Skip to content

Commit

Permalink
Merge pull request #15 from sibyabin/feature/social-media-sharing
Browse files Browse the repository at this point in the history
adding related blogs
  • Loading branch information
sibyabin committed Apr 17, 2023
2 parents 1844d55 + 9ab191f commit 4ec440e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _includes/related-posts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% assign current_post_category = page.category %}
{% assign related_posts = site.posts | where: "category", current_post_category %}
{% if related_posts.size > 0 %}
<h3>Related Posts</h3>
<ul>
{% for post in related_posts limit:5 %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endif %}

0 comments on commit 4ec440e

Please sign in to comment.