jekyll 3.1.3 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jekyll might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/jekyll.rb +5 -7
- data/lib/jekyll/configuration.rb +31 -6
- data/lib/jekyll/convertible.rb +4 -1
- data/lib/jekyll/drops/drop.rb +8 -2
- data/lib/jekyll/drops/excerpt_drop.rb +15 -0
- data/lib/jekyll/drops/site_drop.rb +1 -1
- data/lib/jekyll/excerpt.rb +2 -5
- data/lib/jekyll/plugin_manager.rb +1 -1
- data/lib/jekyll/renderer.rb +4 -1
- data/lib/jekyll/utils.rb +13 -0
- data/lib/jekyll/version.rb +1 -1
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: ae75d5ad382aa7a321b45009c2d38f2b2a39f105
         | 
| 4 | 
            +
              data.tar.gz: 3695125fde0f734ea527906b200f670699910fed
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e6cd200a9084f7783d4674070006f488db49c182745dbf452c1717309b5b7012e3e381873cb523e8c429f89d565bab69549367c56d2d85f231cef8e779f093db
         | 
| 7 | 
            +
              data.tar.gz: 4c135aeeafb3269a8433c7a9a26783ec690c663e5d9f750faa06a4d8c283868416ceb5a38639974ee4a64b67a0e4a762a3b1e08b47e23e90c53d2d7bcb1761f3
         | 
    
        data/lib/jekyll.rb
    CHANGED
    
    | @@ -95,18 +95,16 @@ module Jekyll | |
| 95 95 | 
             
                #            list of option names and their defaults.
         | 
| 96 96 | 
             
                #
         | 
| 97 97 | 
             
                # Returns the final configuration Hash.
         | 
| 98 | 
            -
                def configuration(override =  | 
| 99 | 
            -
                  config = Configuration | 
| 100 | 
            -
                  override = Configuration[override].stringify_keys
         | 
| 98 | 
            +
                def configuration(override = Hash.new)
         | 
| 99 | 
            +
                  config = Configuration.new
         | 
| 101 100 | 
             
                  unless override.delete('skip_config_files')
         | 
| 102 101 | 
             
                    config = config.read_config_files(config.config_files(override))
         | 
| 103 102 | 
             
                  end
         | 
| 104 103 |  | 
| 105 104 | 
             
                  # Merge DEFAULTS < _config.yml < override
         | 
| 106 | 
            -
                   | 
| 107 | 
            -
             | 
| 108 | 
            -
             | 
| 109 | 
            -
                  config
         | 
| 105 | 
            +
                  Configuration.from(Utils.deep_merge_hashes(config, override)).tap do |config|
         | 
| 106 | 
            +
                    set_timezone(config['timezone']) if config['timezone']
         | 
| 107 | 
            +
                  end
         | 
| 110 108 | 
             
                end
         | 
| 111 109 |  | 
| 112 110 | 
             
                # Public: Set the TZ environment variable to use the timezone specified
         | 
    
        data/lib/jekyll/configuration.rb
    CHANGED
    
    | @@ -71,7 +71,24 @@ module Jekyll | |
| 71 71 | 
             
                    'hard_wrap'      => false,
         | 
| 72 72 | 
             
                    'footnote_nr'    => 1
         | 
| 73 73 | 
             
                  }
         | 
| 74 | 
            -
                }]
         | 
| 74 | 
            +
                }.map { |k, v| [k, v.freeze] }].freeze
         | 
| 75 | 
            +
             | 
| 76 | 
            +
                class << self
         | 
| 77 | 
            +
                  # Static: Produce a Configuration ready for use in a Site.
         | 
| 78 | 
            +
                  # It takes the input, fills in the defaults where values do not
         | 
| 79 | 
            +
                  # exist, and patches common issues including migrating options for
         | 
| 80 | 
            +
                  # backwards compatiblity. Except where a key or value is being fixed,
         | 
| 81 | 
            +
                  # the user configuration will override the defaults.
         | 
| 82 | 
            +
                  #
         | 
| 83 | 
            +
                  # user_config - a Hash or Configuration of overrides.
         | 
| 84 | 
            +
                  #
         | 
| 85 | 
            +
                  # Returns a Configuration filled with defaults and fixed for common
         | 
| 86 | 
            +
                  # problems and backwards-compatibility.
         | 
| 87 | 
            +
                  def from(user_config)
         | 
| 88 | 
            +
                    Utils.deep_merge_hashes(DEFAULTS, Configuration[user_config].stringify_keys).
         | 
| 89 | 
            +
                      fix_common_issues.add_default_collections
         | 
| 90 | 
            +
                  end
         | 
| 91 | 
            +
                end
         | 
| 75 92 |  | 
| 76 93 | 
             
                # Public: Turn all keys into string
         | 
| 77 94 | 
             
                #
         | 
| @@ -168,6 +185,7 @@ module Jekyll | |
| 168 185 |  | 
| 169 186 | 
             
                  begin
         | 
| 170 187 | 
             
                    files.each do |config_file|
         | 
| 188 | 
            +
                      next if config_file.nil? or config_file.empty?
         | 
| 171 189 | 
             
                      new_config = read_config_file(config_file)
         | 
| 172 190 | 
             
                      configuration = Utils.deep_merge_hashes(configuration, new_config)
         | 
| 173 191 | 
             
                    end
         | 
| @@ -227,7 +245,6 @@ module Jekyll | |
| 227 245 | 
             
                  end
         | 
| 228 246 |  | 
| 229 247 | 
             
                  %w(include exclude).each do |option|
         | 
| 230 | 
            -
                    config[option] ||= []
         | 
| 231 248 | 
             
                    if config[option].is_a?(String)
         | 
| 232 249 | 
             
                      Jekyll::Deprecator.deprecation_message "The '#{option}' configuration option" \
         | 
| 233 250 | 
             
                        " must now be specified as an array, but you specified" \
         | 
| @@ -235,7 +252,7 @@ module Jekyll | |
| 235 252 | 
             
                        " as a list of comma-separated values."
         | 
| 236 253 | 
             
                      config[option] = csv_to_array(config[option])
         | 
| 237 254 | 
             
                    end
         | 
| 238 | 
            -
                    config[option].map!(&:to_s)
         | 
| 255 | 
            +
                    config[option].map!(&:to_s) if config[option]
         | 
| 239 256 | 
             
                  end
         | 
| 240 257 |  | 
| 241 258 | 
             
                  if (config['kramdown'] || {}).key?('use_coderay')
         | 
| @@ -270,14 +287,22 @@ module Jekyll | |
| 270 287 | 
             
                def add_default_collections
         | 
| 271 288 | 
             
                  config = clone
         | 
| 272 289 |  | 
| 290 | 
            +
                  # It defaults to `{}`, so this is only if someone sets it to null manually.
         | 
| 273 291 | 
             
                  return config if config['collections'].nil?
         | 
| 274 292 |  | 
| 293 | 
            +
                  # Ensure we have a hash.
         | 
| 275 294 | 
             
                  if config['collections'].is_a?(Array)
         | 
| 276 295 | 
             
                    config['collections'] = Hash[config['collections'].map { |c| [c, {}] }]
         | 
| 277 296 | 
             
                  end
         | 
| 278 | 
            -
             | 
| 279 | 
            -
                  config['collections'] | 
| 280 | 
            -
             | 
| 297 | 
            +
             | 
| 298 | 
            +
                  config['collections'] = Utils.deep_merge_hashes(
         | 
| 299 | 
            +
                    { 'posts' => {} }, config['collections']
         | 
| 300 | 
            +
                  ).tap do |collections|
         | 
| 301 | 
            +
                    collections['posts']['output'] = true
         | 
| 302 | 
            +
                    if config['permalink']
         | 
| 303 | 
            +
                      collections['posts']['permalink'] ||= style_to_permalink(config['permalink'])
         | 
| 304 | 
            +
                    end
         | 
| 305 | 
            +
                  end
         | 
| 281 306 |  | 
| 282 307 | 
             
                  config
         | 
| 283 308 | 
             
                end
         | 
    
        data/lib/jekyll/convertible.rb
    CHANGED
    
    | @@ -209,10 +209,13 @@ module Jekyll | |
| 209 209 |  | 
| 210 210 | 
             
                  used = Set.new([layout])
         | 
| 211 211 |  | 
| 212 | 
            +
                  # Reset the payload layout data to ensure it starts fresh for each page.
         | 
| 213 | 
            +
                  payload["layout"] = nil
         | 
| 214 | 
            +
             | 
| 212 215 | 
             
                  while layout
         | 
| 213 216 | 
             
                    Jekyll.logger.debug "Rendering Layout:", path
         | 
| 214 217 | 
             
                    payload["content"] = output
         | 
| 215 | 
            -
                    payload["layout"]  = Utils.deep_merge_hashes(payload["layout"] || {} | 
| 218 | 
            +
                    payload["layout"]  = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})
         | 
| 216 219 |  | 
| 217 220 | 
             
                    self.output = render_liquid(layout.content,
         | 
| 218 221 | 
             
                                                     payload,
         | 
    
        data/lib/jekyll/drops/drop.rb
    CHANGED
    
    | @@ -3,7 +3,7 @@ | |
| 3 3 | 
             
            module Jekyll
         | 
| 4 4 | 
             
              module Drops
         | 
| 5 5 | 
             
                class Drop < Liquid::Drop
         | 
| 6 | 
            -
                  NON_CONTENT_METHODS = [: | 
| 6 | 
            +
                  NON_CONTENT_METHODS = [:fallback_data].freeze
         | 
| 7 7 |  | 
| 8 8 | 
             
                  # Get or set whether the drop class is mutable.
         | 
| 9 9 | 
             
                  # Mutability determines whether or not pre-defined fields may be
         | 
| @@ -86,7 +86,7 @@ module Jekyll | |
| 86 86 | 
             
                  # Returns an Array of strings which represent method-specific keys.
         | 
| 87 87 | 
             
                  def content_methods
         | 
| 88 88 | 
             
                    @content_methods ||= (
         | 
| 89 | 
            -
                      self.class.instance_methods | 
| 89 | 
            +
                      self.class.instance_methods - Jekyll::Drops::Drop.instance_methods - NON_CONTENT_METHODS
         | 
| 90 90 | 
             
                    ).map(&:to_s).reject do |method|
         | 
| 91 91 | 
             
                      method.end_with?("=")
         | 
| 92 92 | 
             
                    end
         | 
| @@ -147,6 +147,12 @@ module Jekyll | |
| 147 147 | 
             
                    keys.each(&block)
         | 
| 148 148 | 
             
                  end
         | 
| 149 149 |  | 
| 150 | 
            +
                  def each(&block)
         | 
| 151 | 
            +
                    each_key.each do |key|
         | 
| 152 | 
            +
                      yield key, self[key]
         | 
| 153 | 
            +
                    end
         | 
| 154 | 
            +
                  end
         | 
| 155 | 
            +
             | 
| 150 156 | 
             
                  def merge(other, &block)
         | 
| 151 157 | 
             
                    self.dup.tap do |me|
         | 
| 152 158 | 
             
                      if block.nil?
         | 
    
        data/lib/jekyll/excerpt.rb
    CHANGED
    
    | @@ -7,7 +7,7 @@ module Jekyll | |
| 7 7 | 
             
                attr_writer   :output
         | 
| 8 8 |  | 
| 9 9 | 
             
                def_delegators :@doc, :site, :name, :ext, :relative_path, :extname,
         | 
| 10 | 
            -
                                      :render_with_liquid?, :collection, :related_posts
         | 
| 10 | 
            +
                                      :render_with_liquid?, :collection, :related_posts, :url
         | 
| 11 11 |  | 
| 12 12 | 
             
                # Initialize this Excerpt instance.
         | 
| 13 13 | 
             
                #
         | 
| @@ -59,10 +59,7 @@ module Jekyll | |
| 59 59 | 
             
                end
         | 
| 60 60 |  | 
| 61 61 | 
             
                def to_liquid
         | 
| 62 | 
            -
                   | 
| 63 | 
            -
                  @to_liquid ||= doc.to_liquid
         | 
| 64 | 
            -
                  doc.data['excerpt'] = self
         | 
| 65 | 
            -
                  @to_liquid
         | 
| 62 | 
            +
                  Jekyll::Drops::ExcerptDrop.new(self)
         | 
| 66 63 | 
             
                end
         | 
| 67 64 |  | 
| 68 65 | 
             
                # Returns the shorthand String identifier of this doc.
         | 
| @@ -76,7 +76,7 @@ module Jekyll | |
| 76 76 | 
             
                #
         | 
| 77 77 | 
             
                # Returns an Array of plugin search paths
         | 
| 78 78 | 
             
                def plugins_path
         | 
| 79 | 
            -
                  if site.config['plugins_dir']  | 
| 79 | 
            +
                  if site.config['plugins_dir'].eql? Jekyll::Configuration::DEFAULTS['plugins_dir']
         | 
| 80 80 | 
             
                    [site.in_source_dir(site.config['plugins_dir'])]
         | 
| 81 81 | 
             
                  else
         | 
| 82 82 | 
             
                    Array(site.config['plugins_dir']).map { |d| File.expand_path(d) }
         | 
    
        data/lib/jekyll/renderer.rb
    CHANGED
    
    | @@ -135,10 +135,13 @@ module Jekyll | |
| 135 135 |  | 
| 136 136 | 
             
                  used   = Set.new([layout])
         | 
| 137 137 |  | 
| 138 | 
            +
                  # Reset the payload layout data to ensure it starts fresh for each page.
         | 
| 139 | 
            +
                  payload["layout"] = nil
         | 
| 140 | 
            +
             | 
| 138 141 | 
             
                  while layout
         | 
| 139 142 | 
             
                    payload['content'] = output
         | 
| 140 143 | 
             
                    payload['page']    = document.to_liquid
         | 
| 141 | 
            -
                    payload['layout']  = Utils.deep_merge_hashes(payload[ | 
| 144 | 
            +
                    payload['layout']  = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})
         | 
| 142 145 |  | 
| 143 146 | 
             
                    output = render_liquid(
         | 
| 144 147 | 
             
                      layout.content,
         | 
    
        data/lib/jekyll/utils.rb
    CHANGED
    
    | @@ -53,6 +53,10 @@ module Jekyll | |
| 53 53 | 
             
                    target.default_proc = overwrite.default_proc
         | 
| 54 54 | 
             
                  end
         | 
| 55 55 |  | 
| 56 | 
            +
                  target.each do |key, val|
         | 
| 57 | 
            +
                    target[key] = val.dup if val.frozen? && duplicable?(val)
         | 
| 58 | 
            +
                  end
         | 
| 59 | 
            +
             | 
| 56 60 | 
             
                  target
         | 
| 57 61 | 
             
                end
         | 
| 58 62 |  | 
| @@ -60,6 +64,15 @@ module Jekyll | |
| 60 64 | 
             
                  value.is_a?(Hash) || value.is_a?(Drops::Drop)
         | 
| 61 65 | 
             
                end
         | 
| 62 66 |  | 
| 67 | 
            +
                def duplicable?(obj)
         | 
| 68 | 
            +
                  case obj
         | 
| 69 | 
            +
                  when nil, false, true, Symbol, Numeric
         | 
| 70 | 
            +
                    false
         | 
| 71 | 
            +
                  else
         | 
| 72 | 
            +
                    true
         | 
| 73 | 
            +
                  end
         | 
| 74 | 
            +
                end
         | 
| 75 | 
            +
             | 
| 63 76 | 
             
                # Read array from the supplied hash favouring the singular key
         | 
| 64 77 | 
             
                # and then the plural key, and handling any nil entries.
         | 
| 65 78 | 
             
                #
         | 
    
        data/lib/jekyll/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: jekyll
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 3.1. | 
| 4 | 
            +
              version: 3.1.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tom Preston-Werner
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016- | 
| 11 | 
            +
            date: 2016-05-18 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: liquid
         | 
| @@ -160,6 +160,7 @@ files: | |
| 160 160 | 
             
            - lib/jekyll/drops/collection_drop.rb
         | 
| 161 161 | 
             
            - lib/jekyll/drops/document_drop.rb
         | 
| 162 162 | 
             
            - lib/jekyll/drops/drop.rb
         | 
| 163 | 
            +
            - lib/jekyll/drops/excerpt_drop.rb
         | 
| 163 164 | 
             
            - lib/jekyll/drops/jekyll_drop.rb
         | 
| 164 165 | 
             
            - lib/jekyll/drops/site_drop.rb
         | 
| 165 166 | 
             
            - lib/jekyll/drops/unified_payload_drop.rb
         |