Sha256: 0d22522f2e681b6b799d8850432fc423fcb19a9817e2ff8201e2d8fa8507516f

Contents?: true

Size: 895 Bytes

Versions: 9

Compression:

Stored size: 895 Bytes

Contents

module Jekyll

  class Layout
    include Convertible

    # Gets the Site object.
    attr_reader :site

    # 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

9 entries across 9 versions & 3 rubygems

Version Path
jekyll-0.12.1 lib/jekyll/layout.rb
jekyll-0.12.0 lib/jekyll/layout.rb
spinto-jekyll-0.11.2.5 lib/jekyll/layout.rb
spinto-jekyll-0.11.2.3 lib/jekyll/layout.rb
spinto-jekyll-0.11.2.2 lib/jekyll/layout.rb
spinto-jekyll-0.11.2.1 lib/jekyll/layout.rb
jekyll-0.11.2 lib/jekyll/layout.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/jekyll-0.11.0/lib/jekyll/layout.rb
jekyll-0.11.0 lib/jekyll/layout.rb