Sha256: f2c7a95efa53f374e7d2c97844ae30e248d736e049f934f6b8ef6bbac4ec56cc

Contents?: true

Size: 1.02 KB

Versions: 33

Compression:

Stored size: 1.02 KB

Contents

module Jekyll
  class Layout
    include Convertible

    # Gets the Site object.
    attr_reader :site

    # Gets the name of this layout.
    attr_reader :name

    # Gets the path to this layout.
    attr_reader :path

    # 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
      @path = site.in_source_dir(base, 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

33 entries across 33 versions & 3 rubygems

Version Path
blackboard-3.1.9 lib/jekyll/layout.rb
blackboard-3.1.8 lib/jekyll/layout.rb
blackboard-3.1.7 lib/jekyll/layout.rb
jekyll-3.1.6 lib/jekyll/layout.rb
jekyll-3.1.5 lib/jekyll/layout.rb
jekyll-3.1.4 lib/jekyll/layout.rb
jekyll-3.0.5 lib/jekyll/layout.rb
jekyll-3.1.3 lib/jekyll/layout.rb
jekyll-3.0.4 lib/jekyll/layout.rb
jekyll-3.1.2 lib/jekyll/layout.rb
jekyllplusadmin-1.1.0 lib/jekyll/layout.rb
jekyllplusadmin-1.0.0 lib/jekyll/layout.rb
jekyll-3.0.3 lib/jekyll/layout.rb
jekyll-3.1.1 lib/jekyll/layout.rb
jekyll-3.1.0 lib/jekyll/layout.rb
jekyll-3.1.0.pre.rc3 lib/jekyll/layout.rb
jekyll-3.0.2 lib/jekyll/layout.rb
jekyll-3.1.0.pre.rc2 lib/jekyll/layout.rb
jekyll-3.1.0.pre.rc1 lib/jekyll/layout.rb
jekyll-3.1.0.pre.beta1 lib/jekyll/layout.rb