Class: Jekyll::LayoutReader

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/readers/layout_reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site) ⇒ LayoutReader

Returns a new instance of LayoutReader.



4
5
6
7
# File 'lib/jekyll/readers/layout_reader.rb', line 4

def initialize(site)
  @site = site
  @layouts = {}
end

Instance Attribute Details

#siteObject (readonly)

Returns the value of attribute site.



3
4
5
# File 'lib/jekyll/readers/layout_reader.rb', line 3

def site
  @site
end

Instance Method Details

#layout_directoryObject



17
18
19
# File 'lib/jekyll/readers/layout_reader.rb', line 17

def layout_directory
  @layout_directory ||= (layout_directory_in_cwd || layout_directory_inside_source)
end

#readObject



9
10
11
12
13
14
15
# File 'lib/jekyll/readers/layout_reader.rb', line 9

def read
  layout_entries.each do |f|
    @layouts[layout_name(f)] = Layout.new(site, layout_directory, f)
  end

  @layouts
end