Skip to content

Commit

Permalink
Version
Browse files Browse the repository at this point in the history
  • Loading branch information
rphillips-nz committed Nov 19, 2019
1 parent afe7f9c commit 8dadf1c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
50 changes: 24 additions & 26 deletions lib/cloudcannon-jekyll/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,37 @@

module CloudCannonJekyll
class Configuration
class << self
def processed?(site)
site.instance_variable_get(:@_cloudcannon_jekyll_processed) == true
end

def process(site)
site.instance_variable_set :@_cloudcannon_jekyll_processed, true
end
def self.processed?(site)
site.instance_variable_get(:@_cloudcannon_jekyll_processed) == true
end

def overridden_config(user_config)
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
def self.process(site)
site.instance_variable_set :@_cloudcannon_jekyll_processed, true
end

key = Jekyll::VERSION.start_with?("2") ? "gems" : "plugins"
def self.overridden_config(user_config)
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

config[key] = Array(config[key])
config[key].push("cloudcannon-jekyll") unless config[key].include? "cloudcannon-jekyll"
config
end
key = Jekyll::VERSION.start_with?("2") ? "gems" : "plugins"

def set(site)
return if processed? site
config[key] = Array(config[key])
config[key].push("cloudcannon-jekyll") unless config[key].include? "cloudcannon-jekyll"
config
end

if site.respond_to? :config=
site.config = overridden_config(site.config)
else # Jekyll pre 3.5
site.instance_variable_set :@config, overridden_config(site.config)
end
def self.set(site)
return if processed? site

process(site)
if site.respond_to? :config=
site.config = overridden_config(site.config)
else # Jekyll pre 3.5
site.instance_variable_set :@config, overridden_config(site.config)
end

process(site)
end
end
end
2 changes: 1 addition & 1 deletion lib/cloudcannon-jekyll/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module CloudCannonJekyll
VERSION = "0.0.2"
VERSION = "0.0.4"
end

0 comments on commit 8dadf1c

Please sign in to comment.