Merge pull request #16 from jayvdb/allow-missing

jekyll-analytics.rb: Allow missing config
This commit is contained in:
Hendrik Schneider 2018-03-10 02:04:08 +01:00 committed by GitHub
commit a9dfc1fcc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,7 @@ Dir[File.dirname(__FILE__) + '/analytics/*.rb'].each {|file| require file[0..-4]
CONFIG_KEY = "jekyll_analytics"
def inject(site)
if ENV['JEKYLL_ENV']
if ENV['JEKYLL_ENV'] and site.site.config.has_key? CONFIG_KEY
site.site.config[CONFIG_KEY].keys().each{ |a|
analyzerClass = Module.const_get(a)
config = site.site.config[CONFIG_KEY][a]