lib/jekyll/configuration.rb
def add_default_collections
      config = clone

      # It defaults to `{}`, so this is only if someone sets it to null manually.
      return config if config["collections"].nil?

      # Ensure we have a hash.
      if config["collections"].is_a?(Array)
        config["collections"] = Hash[config["collections"].map { |c| [c, {}] }]
      end

      config["collections"] = Utils.deep_merge_hashes(
        { "posts" => {} }, config["collections"]
      ).tap do |collections|
        collections["posts"]["output"] = true
        if config["permalink"]
          collections["posts"]["permalink"] ||= style_to_permalink(config["permalink"])
        end
      end

      config
    end
# Default options. Overridden by values in _config.yml.
# Strings rather than symbols are used for compatibility with YAML.
Default options. Overridden by values in _config.yml.
Strings rather than symbols are used for compatibility with YAML.
Default options . Overridden by values in _config . yml . Strings rather than symbols are used for compatibility with YAML .
def add_default_collections
      config = clone
      return config if config["collections"].nil?
      if config["collections"].is_a?(Array)
        config["collections"] = Hash[config["collections"].map { |c| [c, {}] }]
      end
      config["collections"] = Utils.deep_merge_hashes(
        { "posts" => {} }, config["collections"]
      ).tap do |collections|
        collections["posts"]["output"] = true
        if config["permalink"]
          collections["posts"]["permalink"] ||= style_to_permalink(config["permalink"])
        end
      end
      config
    end
def add_default_collections config = clone return config if config [ "collections" ] . nil? if config [ "collections" ] . is_a? ( Array ) config [ "collections" ] = Hash [ config [ "collections" ] . map { | c | [ c , { } ] } ] end config [ "collections" ] = Utils . deep_merge_hashes ( { "posts" => { } } , config [ "collections" ] ) . tap do | collections | collections [ "posts" ] [ "output" ] = true if config [ "permalink" ] collections [ "posts" ] [ "permalink" ] ||= style_to_permalink ( config [ "permalink" ] ) end end config end
Default options.
Default options .
# It defaults to `{}`, so this is only if someone sets it to null manually. # Ensure we have a hash.