Module: CategoryCombiner

Included in:
JekyllPluginTemplate
Defined in:
lib/category_combiner.rb

Overview

Testing…

Class Method Summary collapse

Class Method Details

.combineObject

For each catagory, makes a combined page from the collection pages, saves into _site/combined/#CategoryCombiner.collectioncollection.label.html.



4
5
6
7
8
9
10
11
12
# File 'lib/category_combiner.rb', line 4

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