Class: Jekyll::TagPage

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

Instance Method Summary collapse

Constructor Details

#initialize(site, base, tag_name, tag_slug) ⇒ TagPage

Returns a new instance of TagPage.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/generators/blog-taxonomy.rb', line 37

def initialize(site, base, tag_name, tag_slug)
  @site = site
  @base = base
  @dir = "blog/tags"
  @name = "#{tag_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/tags/tag'

  # Set page data
  self.data['tag'] = {
    'name' => tag_name,
    'slug' => tag_slug
  }
  self.data['title'] = "#{tag_name} - Blog Tags"
  self.data['meta'] = {
    'title' => "#{tag_name} - Blog Tags - #{site.config.dig('brand', 'name') || site.config['title'] || ''}",
    'description' => "Browse all blog posts tagged with #{tag_name}.",
    'breadcrumb' => tag_name
  }
end