18F/18f.gsa.gov — pull request #372 by gboone (2014-11-19 19:55:50+00:00)
Title: Implement related posts

I am very open to suggestions on this one. The built in [`related_posts`]() variable in `site.related_posts` proved to be pretty unreliable. On every post it gave us only the 10 most recent posts. This adds the related post capability as a Liquid template tag, use it like `{% related_posts %}` which pulls in a unordered list of five post titles from recent posts tagged similarly to the post in context. I, uh, think that is clear? Basically, if you're on a post tagged "18F" you'll get up to five other posts tagged "18F".

It's not super smart. A smarter way might be to prioritize tags with lots of posts over tags with only a few posts. It also doesn't know what to do if it can't find 5 posts. [This post](https://18f.gsa.gov/2014/11/17/taking-control-of-our-website-with-jekyll-and-webhooks/) for example, only has one related post. But it's a good start. I think. I tried using some of the [existing](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin/) [plugins](https://github.com/jumanji27/related_posts-jekyll_plugin/) that attempt to enhance the functionality built-in to Jekyll but this seemed simpler.