lib/octopress-ink/plugin.rb in octopress-ink-1.0.0.alpha.17 vs lib/octopress-ink/plugin.rb in octopress-ink-1.0.0.alpha.18
- old
+ new
@@ -1,8 +1,8 @@
module Octopress
class Plugin
- attr_accessor :name, :type, :asset_override, :assets_path,
+ attr_accessor :name, :type, :asset_override, :assets_path, :config,
:layouts_dir, :stylesheets_dir, :javascripts_dir, :files_dir, :includes_dir, :images_dir,
:layouts, :includes, :stylesheets, :javascripts, :images, :sass, :fonts, :files
def initialize(name, type)
@layouts_dir = 'layouts'
@@ -10,10 +10,11 @@
@fonts_dir = 'fonts'
@images_dir = 'images'
@includes_dir = 'includes'
@javascripts_dir = 'javascripts'
@stylesheets_dir = 'stylesheets'
+ @config_file = 'config.yml'
@name = name
@type = type
@layouts = []
@includes = []
@stylesheets = []
@@ -23,16 +24,21 @@
@fonts = []
@files = []
add_assets
add_layouts
add_includes
+ add_config
end
def add_assets
end
+ def add_config
+ @config = Assets::Config.new(self, @config_file)
+ end
+
def namespace
if @type == 'local_plugin'
''
else
@type == 'theme' ? @type : @name
@@ -136,8 +142,12 @@
files.dup.map { |f| f.tag }
end
def include(file, site)
@includes.file(file, site)
+ end
+
+ def configs(site)
+ @config.read(site)
end
end
end