Jekyll related posts
Jekyll has related posts functionality built in, but it is flawed, especially when deployed on GitHub pages, because related posts are the same for each post. I wanted to be able to add related posts manually, and after little tweaking it turned out to be pretty easy.
I wanted to define related posts by title, but this can be easily changed. In your post template add this code snippet where you want the related posts to show up.
After you have added the code to your post template, just use related_posts
parameter in your YAML front matter. An example from this blog post.
If you want to change the way how related posts are defined, just change the post parameter in if
condition: {% if page.related contains post.title %}
. For example, if you want to define related posts by url, the code would look like this: {% if page.related contains post.url %}