lib/octopress-ink/assets/layout.rb in octopress-ink-1.0.0.alpha.33 vs lib/octopress-ink/assets/layout.rb in octopress-ink-1.0.0.alpha.34
- old
+ new
@@ -1,22 +1,25 @@
module Octopress
module Ink
module Assets
class Layout < Asset
+ def initialize(plugin, base, file)
+ super
+ register
+ end
+
def register
- file = user_path
dir = user_dir
- if !exists?(file)
- file = plugin_path
+ if !exists?(File.join(dir, file))
dir = plugin_dir
end
- Plugins.site.layouts[name] = Jekyll::Layout.new(Plugins.site, dir, @file)
+ Plugins.site.layouts[name] = Jekyll::Layout.new(Plugins.site, dir, file)
end
def name
- name = "#{@plugin.slug}:#{@file}"
+ name = "#{plugin.slug}:#{file}"
# remove extension
name = name.split(".")[0..-2].join(".")
end
end
end