lib/octopress-docs/doc.rb in octopress-docs-0.0.8 vs lib/octopress-docs/doc.rb in octopress-docs-0.0.9
- old
+ new
@@ -9,11 +9,11 @@
@file_dir = File.dirname(@file)
@plugin_name = options[:name]
@plugin_slug = options[:slug]
@plugin_type = options[:type]
@base_url = options[:base_url]
- @index = options[:index]
+ @data = options[:data] || {}
end
# Add doc page to Jekyll pages
#
def add
@@ -42,11 +42,11 @@
'name' => @plugin_name,
'slug' => plugin_slug,
'docs_base_url' => @base_url
}
@page.data['dir'] = doc_dir
- @page.data['permalink'] = "/" if @index
+ @page.data = @data.merge(@page.data)
@page
end
private
@@ -57,10 +57,10 @@
def read
File.open(File.join(@dir, @file)).read
end
def plugin_slug
- Filters.sluggify @plugin_type == 'theme' ? 'theme' : @plugin_slug
+ Jekyll::Utils.slugify(@plugin_type == 'theme' ? 'theme' : @plugin_slug)
end
def page_dir
@file_dir == '.' ? '' : @file_dir
end