Class: Jekyll::Layout
- Inherits:
-
Object
- Object
- Jekyll::Layout
- Includes:
- Convertible
- Defined in:
- lib/jekyll/layout.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#data ⇒ Object
Returns the value of attribute data.
-
#ext ⇒ Object
Returns the value of attribute ext.
-
#site ⇒ Object
Returns the value of attribute site.
Instance Method Summary collapse
-
#initialize(site, base, name) ⇒ Layout
constructor
Initialize a new Layout.
-
#process(name) ⇒ Object
Extract information from the layout filename
name
is the String filename of the layout file.
Methods included from Convertible
#content_type, #do_layout, #read_yaml, #render_haml_in_context, #to_s, #transform
Constructor Details
#initialize(site, base, name) ⇒ Layout
Initialize a new Layout.
+site+ is the Site
+base+ is the String path to the <source>
+name+ is the String filename of the post file
Returns <Page>
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jekyll/layout.rb', line 16 def initialize(site, base, name) @site = site @base = base @name = name self.data = {} self.process(name) self.read_yaml(base, name) self.transform end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
8 9 10 |
# File 'lib/jekyll/layout.rb', line 8 def content @content end |
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/jekyll/layout.rb', line 8 def data @data end |
#ext ⇒ Object
Returns the value of attribute ext.
7 8 9 |
# File 'lib/jekyll/layout.rb', line 7 def ext @ext end |
#site ⇒ Object
Returns the value of attribute site.
6 7 8 |
# File 'lib/jekyll/layout.rb', line 6 def site @site end |
Instance Method Details
#process(name) ⇒ Object
Extract information from the layout filename
+name+ is the String filename of the layout file
Returns nothing
32 33 34 |
# File 'lib/jekyll/layout.rb', line 32 def process(name) self.ext = File.extname(name) end |