lib/octopress-ink/plugins.rb in octopress-ink-1.0.0.alpha.29 vs lib/octopress-ink/plugins.rb in octopress-ink-1.0.0.alpha.30
- old
+ new
@@ -23,27 +23,30 @@
def self.plugins
[@theme].concat(@plugins).concat(@local_plugins).compact
end
+ def self.site=(site)
+ @site = site
+ end
+
def self.site
@site
end
- def self.config(site=nil)
- @site ||= site
+ def self.config
if @config
@config
else
@config = {}
@config['plugins'] = {}
- @config['theme'] = @theme.nil? ? {} : @theme.configs
+ @config['theme'] = @theme.nil? ? {} : @theme.config
plugins.each do |p|
unless p == @theme
- @config['plugins'][p.name] = p.configs
+ @config['plugins'][p.name] = p.config
end
end
@config
end
@@ -72,15 +75,10 @@
p.layouts.clone.each { |layout| layout.register }
end
end
def self.custom_dir
- config = @site.config
- if config['octopress'] and config['octopress']['custom']
- config['octopress']['custom']
- else
- CUSTOM_DIR
- end
+ @site.config['plugins']
end
def self.fingerprint(paths)
paths = [paths] unless paths.is_a? Array
Digest::MD5.hexdigest(paths.clone.map! { |path| "#{File.mtime(path).to_i}" }.join)