Sha256: d643fc06c39491c61bdf3af698aa76367e59e2b20378c652d9bc101845a7b027

Contents?: true

Size: 952 Bytes

Versions: 17

Compression:

Stored size: 952 Bytes

Contents

module Jekyll
  class Layout
    include Convertible

    # Gets the Site object.
    attr_reader :site

    # Gets the name of this layout.
    attr_reader :name

    # Gets/Sets the extension of this layout.
    attr_accessor :ext

    # Gets/Sets the Hash that holds the metadata for this layout.
    attr_accessor :data

    # Gets/Sets the content of this layout.
    attr_accessor :content

    # Initialize a new Layout.
    #
    # site - The Site.
    # base - The String path to the source.
    # name - The String filename of the post file.
    def initialize(site, base, name)
      @site = site
      @base = base
      @name = name

      self.data = {}

      self.process(name)
      self.read_yaml(base, name)
    end

    # Extract information from the layout filename.
    #
    # name - The String filename of the layout file.
    #
    # Returns nothing.
    def process(name)
      self.ext = File.extname(name)
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
jekyll-1.5.1 lib/jekyll/layout.rb
jekyll-1.5.0 lib/jekyll/layout.rb
jekyll-2.0.0.alpha.1 lib/jekyll/layout.rb
jekyll-1.4.3 lib/jekyll/layout.rb
jekyll-1.4.2 lib/jekyll/layout.rb
jekyll-1.4.1 lib/jekyll/layout.rb
jekyll-1.4.0 lib/jekyll/layout.rb
jekyll-1.3.1 lib/jekyll/layout.rb
jekyll-1.3.0 lib/jekyll/layout.rb
jekyll-1.3.0.rc lib/jekyll/layout.rb
monad-0.0.3 lib/jekyll/layout.rb
jekyll-1.2.1 lib/jekyll/layout.rb
jekyll-1.2.0 lib/jekyll/layout.rb
jekyll-1.0.4 lib/jekyll/layout.rb
jekyll-1.1.2 lib/jekyll/layout.rb
jekyll-1.1.1 lib/jekyll/layout.rb
jekyll-1.0.3 lib/jekyll/layout.rb