Sha256: b85385dd2159cad72f2446108c3145c14647ca9031fdd31cc344caa44a3f60ba

Contents?: true

Size: 942 Bytes

Versions: 16

Compression:

Stored size: 942 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 = {}

      process(name)
      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

16 entries across 16 versions & 1 rubygems

Version Path
jekyll-2.5.3 lib/jekyll/layout.rb
jekyll-2.5.2 lib/jekyll/layout.rb
jekyll-2.5.1 lib/jekyll/layout.rb
jekyll-2.5.0 lib/jekyll/layout.rb
jekyll-2.4.0 lib/jekyll/layout.rb
jekyll-2.3.0 lib/jekyll/layout.rb
jekyll-2.2.0 lib/jekyll/layout.rb
jekyll-2.1.1 lib/jekyll/layout.rb
jekyll-2.1.0 lib/jekyll/layout.rb
jekyll-2.0.3 lib/jekyll/layout.rb
jekyll-2.0.2 lib/jekyll/layout.rb
jekyll-2.0.1 lib/jekyll/layout.rb
jekyll-2.0.0 lib/jekyll/layout.rb
jekyll-2.0.0.rc1 lib/jekyll/layout.rb
jekyll-2.0.0.alpha.3 lib/jekyll/layout.rb
jekyll-2.0.0.alpha.2 lib/jekyll/layout.rb