lib/octopress-ink/plugins.rb in octopress-ink-1.0.0.rc.38 vs lib/octopress-ink/plugins.rb in octopress-ink-1.0.0.rc.39

- old
+ new

@@ -81,25 +81,27 @@ @plugins << new_plugin end end end - def self.config - if @config - @config - else - @config = {} - @config['plugins'] = {} - @config['theme'] = @theme.nil? ? {} : @theme.config + def self.config(lang=nil) + @configs ||= {} + @configs[lang || 'default'] ||= get_config(lang) + end - plugins.each do |p| - unless p == @theme - @config['plugins'][p.slug] = p.config - end - end + def self.get_config(lang=nil) + config = {} + config['plugins'] = {} - @config + plugins.each do |p| + if p == theme + config['theme'] = p.config(lang) + else + config['plugins'][p.slug] = p.config(lang) + end end + + config end # Inclue partials from plugins # def self.include(name, file)