Class: Jekyll::AttendeasePlugin::EventLayoutPage

Inherits:
Page
  • Object
show all
Defined in:
lib/jekyll/attendease_plugin/event_layout_page.rb

Instance Method Summary collapse

Constructor Details

#initialize(site, base, dir, name, base_layout, title_prefix) ⇒ EventLayoutPage

Returns a new instance of EventLayoutPage.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/jekyll/attendease_plugin/event_layout_page.rb', line 4

def initialize(site, base, dir, name, base_layout, title_prefix)
  @site = site
  @base = base
  @dir = dir
  @name = name

  self.process(name)

  self.read_yaml(File.join(base, '_layouts'), "#{base_layout}.html")

  self.data = {}

  self.data['layout'] = base_layout
  self.data['base_layout'] = base_layout

  title_prefix = '{{ page.title }}' if title_prefix == 'Layout' # Use a Liquid placeholder for the title of the main layout page.

  self.data['title'] = title_prefix

  self.content = "{% raw %}{{ content }}{% endraw %}"
end