lib/cloudcannon-jekyll/configuration.rb in cloudcannon-jekyll-0.5.0 vs lib/cloudcannon-jekyll/configuration.rb in cloudcannon-jekyll-1.0.0
- old
+ new
@@ -1,9 +1,8 @@
# frozen_string_literal: true
module CloudCannonJekyll
- # Processes Jekyll configuration to enable the plugin is run and fix common issues
class Configuration
def self.processed?(site)
site.instance_variable_get(:@_cloudcannon_jekyll_processed) == true
end
@@ -15,10 +14,10 @@
config = Jekyll::Utils.deep_merge_hashes(Jekyll::Configuration::DEFAULTS, user_config)
config = config.add_default_collections if config.respond_to? :add_default_collections
config = config.fix_common_issues if config.respond_to? :fix_common_issues
config = config.add_default_excludes if config.respond_to? :add_default_excludes
- key = Jekyll::VERSION.start_with?("2.") ? "gems" : "plugins"
+ key = Jekyll::VERSION.start_with?("2") ? "gems" : "plugins"
config[key] = Array(config[key])
config[key].push("cloudcannon-jekyll") unless config[key].include? "cloudcannon-jekyll"
config
end