lib/octopress-ink/assets/page.rb in octopress-ink-1.0.0.alpha.44 vs lib/octopress-ink/assets/page.rb in octopress-ink-1.0.0.alpha.45

- old
+ new

@@ -16,10 +16,20 @@ @file = File.basename(file) @exists = {} file_check end + # Add page to Jekyll pages if no other page has a conflicting destination + # + def add + if page.url && !Ink.config['docs_mode'] + Ink.site.pages << page unless Helpers::Path.find_page(page) + end + end + + private + def page_dir dir == '.' ? '' : dir end def plugin_path @@ -29,22 +39,14 @@ def url_info "/#{page.url.sub(/^\//,'')}" end def user_dir - File.join Plugins.site.source, Plugins.custom_dir, plugin.slug, base + File.join Ink.site.source, Plugins.custom_dir, plugin.slug, base end def page - @page ||= Page.new(Plugins.site, source_dir, page_dir, file, plugin.config) - end - - # Add page to Jekyll pages if no other page has a conflicting destination - # - def add - if page.url && !Ink.config['docs_mode'] - Plugins.site.pages << page unless Helpers::Path.find_page(page) - end + @page ||= Page.new(Ink.site, source_dir, page_dir, file, plugin.config) end end end end end