Class: Rop::FilteredIndexPage
- Inherits:
-
Jekyll::Page
- Object
- Jekyll::Page
- Rop::FilteredIndexPage
- Defined in:
- lib/rop/filterable_index.rb
Overview
Each software or spec item can have its tags, and the theme allows to filter each index by a tag. The below generates an additional index page for each tag in an index, like software/Ruby.
Note: this expects “_pages/<index page>.html” to be present in site source, so it would fail if theme setup instructions were not followed fully.
Instance Method Summary collapse
-
#initialize(site, base, dir, tag, items, index_page) ⇒ FilteredIndexPage
constructor
A new instance of FilteredIndexPage.
Constructor Details
#initialize(site, base, dir, tag, items, index_page) ⇒ FilteredIndexPage
Returns a new instance of FilteredIndexPage.
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/rop/filterable_index.rb', line 104 def initialize(site, base, dir, tag, items, index_page) @site = site @base = base @dir = dir @name = 'index.html' process(@name) read_yaml(File.join(base, '_pages'), "#{index_page}.html") data['tag'] = tag data['items'] = items end |