lib/octopress-ink/assets/layout.rb in octopress-ink-1.0.0.alpha.31 vs lib/octopress-ink/assets/layout.rb in octopress-ink-1.0.0.alpha.32

- old
+ new

@@ -1,20 +1,25 @@ module Octopress - module Assets - class Layout < Asset + module Ink + module Assets + class Layout < Asset - def register - name = "#{@plugin.namespace}:#{@file}" - name = name.split(".")[0..-2].join(".") + def register + file = user_path + dir = user_dir + if !exists?(file) + file = plugin_path + dir = plugin_dir + end - file = user_path - dir = user_dir - if !exists?(file) - file = plugin_path - dir = plugin_dir + Plugins.site.layouts[name] = Jekyll::Layout.new(Plugins.site, dir, @file) end - Plugins.site.layouts[name] = Jekyll::Layout.new(Plugins.site, dir, @file) + def name + name = "#{@plugin.slug}:#{@file}" + # remove extension + name = name.split(".")[0..-2].join(".") + end end end end end