Sha256: bf7cc3e233ef99c09aff7da1ae4f939a8d7e4caba0b844c3cb1b7dda8b68ad65

Contents?: true

Size: 715 Bytes

Versions: 3

Compression:

Stored size: 715 Bytes

Contents

# Testing...
module CategoryCombiner
  # For each catagory, makes a combined page from the collection pages, saves into _site/combined/#{collection.label}.html.
  def combine
    proc do |site, _payload|
      site.collections.each do |_name, collection|
        collection_page = Jekyll::PageWithoutAFile.new(site, site.source, "combined", "#{collection.label}.html")
        collection_page.output = collection.docs.map(&:content).join("\f")
        site.pages << collection_page
      end
    end
  end

  module_function :combine

  Jekyll::Hooks.register(:site, :post_render, &combine)

  PluginMetaLogger.instance.logger.info { "Loaded CategoryCombiner v#{JekyllPluginTemplateVersion::VERSION} plugin." }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll_plugin_template-0.3.1 lib/category_combiner.rb
jekyll_plugin_template-0.3.0 lib/category_combiner.rb
jekyll_plugin_template-0.2.0 lib/category_combiner.rb