diff --git a/lib/jekyll-archives.rb b/lib/jekyll-archives.rb index 94e59a9..56ee470 100644 --- a/lib/jekyll-archives.rb +++ b/lib/jekyll-archives.rb @@ -30,10 +30,15 @@ class Archives < Jekyll::Generator } def initialize(config = nil) + @configs = [] if config['jekyll-archives'].nil? - @config = DEFAULTS + @configs << DEFAULTS + elsif config['jekyll-archives'].is_a? Array + config['jekyll-archives'].each do |c| + @configs << Utils.deep_merge_hashes(DEFAULTS, c) + end else - @config = Utils.deep_merge_hashes(DEFAULTS, config['jekyll-archives']) + @configs << Utils.deep_merge_hashes(DEFAULTS, config['jekyll-archives']) end end @@ -42,9 +47,12 @@ def generate(site) @posts = site.posts @archives = [] - @site.config['jekyll-archives'] = @config + @configs.each do |c| + @config = c + @site.config['jekyll-archives'] = @config + read + end - read @site.pages.concat(@archives) @site.config["archives"] = @archives