class Jekyll::Endless::TagPage

TagPage is a subclass of Page It is used in the `TagPageGenerator`

Public Class Methods

new(site, base, dir, tag) click to toggle source
# File lib/jekyll-theme-endless/generate-tagpages.rb, line 55
def initialize(site, base, dir, tag)
        # Define instance variables ('@') to make values available in the super-class `Page`.
        # The variables are available in the layout as e.g. `page.name`.
        @site = site
        @base = base
        @dir        = dir
        @name = 'index.html'

        self.process(@name)
        self.read_yaml(File.join(base, '_layouts'), 'page-tag.html')

        # The prefix for the generated title is set via `tag_title_prefix` in `_config.yml` and defaults to `Tag: `
        tag_title_prefix = site.config['tag_title_prefix'] || 'Tag: '
        # Generates the title for the tag page and makes it available in the layout file as `page.title`
        self.data['title'] = "#{tag_title_prefix}#{tag}"
        # Makes `page.tag` available in the layout file
        self.data['tag'] = tag

end