Class: Jekyll::CategoryPage

Inherits:
Page
  • Object
show all
Defined in:
lib/generators/blog-taxonomy.rb

Instance Method Summary collapse

Constructor Details

#initialize(site, base, category_name, category_slug) ⇒ CategoryPage

Returns a new instance of CategoryPage.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/generators/blog-taxonomy.rb', line 7

def initialize(site, base, category_name, category_slug)
  @site = site
  @base = base
  @dir = "blog/categories"
  @name = "#{category_slug}.html"

  self.process(@name)

  # Initialize data without reading from file
  self.data = {}
  self.content = ''

  # Set layout - Jekyll will resolve this through its layout chain
  self.data['layout'] = 'blueprint/blog/categories/category'

  # Set page data
  self.data['category'] = {
    'name' => category_name,
    'slug' => category_slug
  }
  self.data['title'] = "#{category_name} - Blog Categories"
  self.data['meta'] = {
    'title' => "#{category_name} - Blog Categories - #{site.config.dig('brand', 'name') || site.config['title'] || ''}",
    'description' => "Browse all blog posts in the #{category_name} category.",
    'breadcrumb' => category_name
  }
end