From 3cef6cb7eab868fe5ec0d7058feda097749514f6 Mon Sep 17 00:00:00 2001 From: Dave Gandy Date: Sun, 10 Jan 2016 21:39:43 -0500 Subject: [PATCH] Icon pages should generate. Silly me. --- src/_plugins/icon_page_generator.rb | 90 ++++++++++++++--------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/src/_plugins/icon_page_generator.rb b/src/_plugins/icon_page_generator.rb index 9caf705e7..32b7cd428 100644 --- a/src/_plugins/icon_page_generator.rb +++ b/src/_plugins/icon_page_generator.rb @@ -1,45 +1,45 @@ -# ## -# # Create individual pages for each icon in the FontAwesome set -# -# require 'yaml' -# -# module Jekyll -# -# class IconPage < Page -# -# ## -# # Take a single icon and render a page for it. -# -# def initialize(site, base, dir, icon) -# @site = site -# @base = base -# @dir = dir -# @name = "#{icon.id}.html" -# @icon = icon -# -# self.process(@name) -# -# self.read_yaml(File.join(base, site.config['layouts']), site.config['icon_layout']) -# -# self.data['icon'] = icon -# self.data['title'] = "fa-#{icon.id}: " + self.data['title_suffix'] -# end -# -# end -# -# class IconGenerator < Generator -# -# ## -# # Iterate over every described icon in a YAML file and create a page for it -# -# safe true -# -# def generate(site) -# site.icons.each do |icon| -# site.pages << IconPage.new(site, site.source, site.config['icon_destination'], icon) -# end -# end -# -# end -# -# end +## +# Create individual pages for each icon in the FontAwesome set + +require 'yaml' + +module Jekyll + + class IconPage < Page + + ## + # Take a single icon and render a page for it. + + def initialize(site, base, dir, icon) + @site = site + @base = base + @dir = dir + @name = "#{icon.id}.html" + @icon = icon + + self.process(@name) + + self.read_yaml(File.join(base, site.config['layouts']), site.config['icon_layout']) + + self.data['icon'] = icon + self.data['title'] = "fa-#{icon.id}: " + self.data['title_suffix'] + end + + end + + class IconGenerator < Generator + + ## + # Iterate over every described icon in a YAML file and create a page for it + + safe true + + def generate(site) + site.icons.each do |icon| + site.pages << IconPage.new(site, site.source, site.config['icon_destination'], icon) + end + end + + end + +end