Class: Jekyll::Paginate::Categories::CategoryPage

Inherits:
Jekyll::Page
  • Object
show all
Defined in:
lib/jekyll-paginate-categories/category-page.rb

Constant Summary collapse

ATTRIBUTES_FOR_LIQUID =

Attributes for Liquid templates

%w(
  category
  content
  dir
  name
  path
  url
)

Instance Method Summary collapse

Constructor Details

#initialize(site, base, category) ⇒ CategoryPage

Initialize a new Page.

site - The Site object. base - The String path to the source. dir - The String path between the source and the file. name - The String filename of the file. category - The String category



23
24
25
26
27
28
29
30
# File 'lib/jekyll-paginate-categories/category-page.rb', line 23

def initialize(site, base, category)
  layout = site.config['paginate_category_layout'] || 'category.html'
  super(site, base, '_layouts', layout)
  process('index.html')

  # Get the category into layout using page.category
  @category = category
end

Instance Method Details

#categoryObject

Produce a category object suitable for Liquid.

Returns a String



35
36
37
38
39
# File 'lib/jekyll-paginate-categories/category-page.rb', line 35

def category
  if @category.is_a? String
    @category
  end
end