lib/octopress-docs.rb in octopress-docs-0.0.9 vs lib/octopress-docs.rb in octopress-docs-0.0.10

- old
+ new

@@ -6,11 +6,10 @@ require "octopress-docs/version" require "octopress-docs/command" require "octopress-docs/page" require "octopress-docs/doc" -require "octopress-docs/tag" require "octopress-docs/hooks" module Octopress unless defined? Octopress.site def self.site @@ -50,14 +49,19 @@ def self.pages_info docs = @docs.clone docs.each { |slug, pages| docs[slug] = { "name" => pages.first.plugin_name, - "docs" => plugin_docs(pages) + "docs" => plugin_docs(pages), + "url" => pages.first.base_url, + "type" => pages.first.plugin_type, + "description" => pages.first.description, + "source_url" => pages.first.source_url } } + { 'plugin_docs' => docs } end def self.plugin_docs(pages) pages.clone.map { |d| @@ -89,10 +93,12 @@ name: plugin.name, slug: plugin.slug, type: plugin.type, base_url: plugin.docs_url, dir: plugin.path, + source_url: plugin.source_url, + website: plugin.website, docs_path: File.join(plugin.assets_path, 'docs'), docs: %w{readme changelog} } end @@ -185,5 +191,14 @@ def self.select_first(dir, match) Dir.new(dir).select { |f| f =~/#{match}/i}.first end end end + +# Add documentation for this plugin + +Octopress::Docs.add({ + name: "Octopress Docs", + description: "The fancy local documentation viewer.", + source_url: "https://github.com/octopress/docs", + dir: File.expand_path(File.join(File.dirname(__FILE__), "../")) +})