Skip to content

Instantly share code, notes, and snippets.

@kobapan
kobapan / tag_aware_previous_next_generator.rb
Last active May 10, 2016 11:35 — forked from stravid/category_aware_next_generator.rb
Tag aware previous next attribute for a Jekyll post
#how to use in template
#
#{{ page.tag }}'s post'
#<a href="{{site.url}}{{ page.tag_previous.url }}">&laquo; {{ page.tag_previous.title }}</a>
#<a href="{{site.url}}{{ page.tag_next.url }}">{{ page.tag_next.title }} &raquo;</a>
#
module Jekyll
class TagAwarePreviousNextGenerator < Generator
safe true