Class: Jekyll::Layout
- Inherits:
-
Object
- Object
- Jekyll::Layout
- Includes:
- Convertible
- Defined in:
- lib/jekyll/layout.rb
Instance Attribute Summary (collapse)
-
- (Object) content
Gets/Sets the content of this layout.
-
- (Object) data
Gets/Sets the Hash that holds the metadata for this layout.
-
- (Object) ext
Gets/Sets the extension of this layout.
-
- (Object) site
readonly
Gets the Site object.
Instance Method Summary (collapse)
-
- (Layout) initialize(site, base, name)
constructor
Initialize a new Layout.
-
- (Object) process(name)
Extract information from the layout filename.
Methods included from Convertible
#converter, #do_layout, #output_ext, #read_yaml, #to_s, #transform, #write
Constructor Details
- (Layout) initialize(site, base, name)
Initialize a new Layout.
site - The Site. base - The String path to the source. name - The String filename of the post file.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/jekyll/layout.rb', line 22 def initialize(site, base, name) @site = site @base = base @name = name self.data = {} self.process(name) self.read_yaml(base, name) end |
Instance Attribute Details
- (Object) content
Gets/Sets the content of this layout.
15 16 17 |
# File 'lib/jekyll/layout.rb', line 15 def content @content end |
- (Object) data
Gets/Sets the Hash that holds the metadata for this layout.
12 13 14 |
# File 'lib/jekyll/layout.rb', line 12 def data @data end |
- (Object) ext
Gets/Sets the extension of this layout.
9 10 11 |
# File 'lib/jekyll/layout.rb', line 9 def ext @ext end |
- (Object) site (readonly)
Gets the Site object.
6 7 8 |
# File 'lib/jekyll/layout.rb', line 6 def site @site end |
Instance Method Details
- (Object) process(name)
Extract information from the layout filename.
name - The String filename of the layout file.
Returns nothing.
38 39 40 |
# File 'lib/jekyll/layout.rb', line 38 def process(name) self.ext = File.extname(name) end |