lib/jekyll/version/build/build-doc.rb
# Main plugin action, called by Jekyll-core
Main plugin action, called by Jekyll-core
Main plugin action called by Jekyll - core
def generate(site)
      return Jekyll.logger.warn "\tJekyll Version Doc: The basic structure for the plugin's operation was not found" if !File.directory?("#{Dir.pwd}/_docs/")
      @site = site
      path = "#{Dir.pwd}/_docs/*"
      Dir[path].each do |filename|
        Jekyll.logger.info "\tSource: #{filename}"
        version = self.getFileVersion(filename)
        summaryFile = "#{filename}/Summary.md"
        summaryList = []
        if File.exists? summaryFile
          summaryList = self.extractInformation(summaryFile, version)
        else
          summaryList = self.extractInformationDir(filename, version)
        end
        filePath = "#{Dir.pwd}/_site/docs/#{version}"
        FileUtils.mkpath(filePath) unless File.exists?(filePath)
        summary_json = PageWithoutAFile.new(site, site.source, "/docs/#{version}", "summary.json")
        summary_json.content = summaryList.to_json
        site.pages << summary_json
        page = Jekyll::PageBuildDocs.new(site, site.source, "/docs/#{version}/", "#{summaryList[0].values[1]}.md", version)
        page.data["sitemap"] = false
        site.pages << page
      end
    end
def generate ( site ) return Jekyll . logger . warn "\tJekyll Version Doc: The basic structure for the plugin's operation was not found" if ! File . directory? ( "#{Dir.pwd}/_docs/" ) @site = site path = "#{Dir.pwd}/_docs/*" Dir [ path ] . each do | filename | Jekyll . logger . info "\tSource: #{filename}" version = self . getFileVersion ( filename ) summaryFile = "#{filename}/Summary.md" summaryList = [ ] if File . exists? summaryFile summaryList = self . extractInformation ( summaryFile , version ) else summaryList = self . extractInformationDir ( filename , version ) end filePath = "#{Dir.pwd}/_site/docs/#{version}" FileUtils . mkpath ( filePath ) unless File . exists? ( filePath ) summary_json = PageWithoutAFile . new ( site , site . source , "/docs/#{version}" , "summary.json" ) summary_json . content = summaryList . to_json site . pages << summary_json page = Jekyll :: PageBuildDocs . new ( site , site . source , "/docs/#{version}/" , "#{summaryList[0].values[1]}.md" , version ) page . data [ "sitemap" ] = false site . pages << page end end
Main plugin action, called by Jekyll-core
Main plugin action called by Jekyll - core
site