Class: Jekyll::CategoryIndex

Inherits:
Page
  • Object
show all
Defined in:
lib/jekyll/category_generator/category_index.rb

Overview

The CategoryIndex class creates a single category page for the specified category.

Instance Method Summary collapse

Constructor Details

#initialize(site, base, category_dir, category) ⇒ CategoryIndex

Initializes a new CategoryIndex.

+base+         is the String path to the <source>.
+category_dir+ is the String path between <source> and the category folder.
+category+     is the category currently being processed.


12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/jekyll/category_generator/category_index.rb', line 12

def initialize(site, base, category_dir, category)
  @site = site
  @base = base
  @dir = category_dir
  @name = 'index.html'
  process(@name)
  # Read the YAML data from the layout page.
  read_yaml(File.join(base, '_layouts'), 'category_index.html')
  data['category'] = category
  # Set the title for this page.
  data['title'] = "#{title_prefix}#{category}"
  # Set the meta-description for this page.
  data['description'] = "#{description_prefix}#{category}"
end