Skip to content

Commit

Permalink
Added related posts section (alshedivat#1168)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demi-wlw authored Mar 11, 2023
1 parent 38373cb commit 49e9fbd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions _includes/related_posts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% assign have_related_posts = false %}

{% for post in site.related_posts | limit: site.related_blog_posts.max_related %}
{% unless have_related_posts %}
{% assign have_related_posts = true %}
<br>
<hr>
<br>
<ul class="list-disc pl-8"></ul>

<!-- Adds related posts to the end of an article -->
<h2 class="text-3xl font-semibold mb-4 mt-12">Enjoy Reading This Article?</h2>
<p class="mb-2">Here are some more articles you might like to read next:</p>
{% endunless %}

<li class="my-2">
<a class="text-pink-700 underline font-semibold hover:text-pink-800" href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}

0 comments on commit 49e9fbd

Please sign in to comment.