Class Nanoc3::Layout
In: lib/nanoc3/base/layout.rb
Parent: Object

Represents a layout in a nanoc site. It has content, attributes, an identifier and a modification time (to speed up compilation).

Methods

[]   inspect   new  

Attributes

attributes  [R]  @return [Hash] This layout‘s attributes
identifier  [RW]  @return [String] This layout‘s identifier, starting and ending with a slash
mtime  [R]  @return [Time] The time when this layout was last modified
raw_content  [R]  @return [String] The raw content of this layout
site  [RW]  @return [Nanoc3::Site] The site this layout belongs to

Public Class methods

Creates a new layout.

@param [String] raw_content The raw content of this layout.

@param [Hash] attributes A hash containing this layout‘s attributes.

@param [String] identifier This layout‘s identifier.

@param [Time, Hash, nil] params_or_mtime Extra parameters for the layout, or the time when this layout was last modified (deprecated).

@option params_or_mtime [Time, nil] :mtime (nil) The time when this layout was last modified

Public Instance methods

Requests the attribute with the given key.

@param [Symbol] key The name of the attribute to fetch.

@return [Object] The value of the requested attribute.

[Validate]