Class: JekyllOpenSdgPlugins::OpenSdgPage
- Inherits:
-
Jekyll::Page
- Object
- Jekyll::Page
- JekyllOpenSdgPlugins::OpenSdgPage
- Defined in:
- lib/jekyll-open-sdg-plugins/create_pages.rb
Overview
A Page subclass used in the ‘CreatePages` class.
Instance Method Summary collapse
-
#initialize(site, base, dir, page, language) ⇒ OpenSdgPage
constructor
A new instance of OpenSdgPage.
Constructor Details
#initialize(site, base, dir, page, language) ⇒ OpenSdgPage
Returns a new instance of OpenSdgPage.
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/jekyll-open-sdg-plugins/create_pages.rb', line 156 def initialize(site, base, dir, page, language) @site = site @base = base index_files = (!page.key?('filename') or page['filename'] == 'index.html' or page['filename'] == '') @dir = index_files ? File.join(dir, '/') : dir @name = index_files ? 'index.html' : page['filename'] self.process(@name) self.data = {} self.data['language'] = language # Add anything else besides "folder" and "filename". This will catch # things like "layout" and "title", and anything else. page.each do |key, value| if key != 'folder' && key != 'filename' self.data[key] = value end end end |