Skip to content

Instantly share code, notes, and snippets.

@you359
Created March 5, 2018 07:31
Show Gist options
  • Save you359/0cd67bcbdf911585f7e4674572ba1184 to your computer and use it in GitHub Desktop.
Save you359/0cd67bcbdf911585f7e4674572ba1184 to your computer and use it in GitHub Desktop.
module Jekyll
class TagIndex < Page
def initialize(site, base, dir, tag)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'tag_index.html')
self.data['tag'] = tag
tag_title_prefix = site.config['tag_title_prefix'] || 'Tagged: '
tag_title_suffix = site.config['tag_title_suffix'] || '&#8211;'
self.data['title'] = "#{tag_title_prefix}#{tag}"
self.data['description'] = "An archive of posts tagged #{tag}."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment