diff options
author | friendica <info@friendica.com> | 2013-10-08 16:11:20 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-10-08 16:11:20 -0700 |
commit | 043042428ce7eea3daec258743349ff23c40b6e6 (patch) | |
tree | 12211165f3d6dee4d93257a3bfd50a52bd29280b /library/font_awesome/src/_plugins/icon_page_generator.rb | |
parent | e9c535f40a591ba9863543673fc91aa76e3a17ac (diff) | |
download | volse-hubzilla-043042428ce7eea3daec258743349ff23c40b6e6.tar.gz volse-hubzilla-043042428ce7eea3daec258743349ff23c40b6e6.tar.bz2 volse-hubzilla-043042428ce7eea3daec258743349ff23c40b6e6.zip |
add font_awesome
Diffstat (limited to 'library/font_awesome/src/_plugins/icon_page_generator.rb')
-rw-r--r-- | library/font_awesome/src/_plugins/icon_page_generator.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/library/font_awesome/src/_plugins/icon_page_generator.rb b/library/font_awesome/src/_plugins/icon_page_generator.rb new file mode 100644 index 000000000..51475e540 --- /dev/null +++ b/library/font_awesome/src/_plugins/icon_page_generator.rb @@ -0,0 +1,46 @@ +## +# Create individual pages for each icon in the FontAwesome set + +require 'yaml' +require 'debugger' + +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'] = "icon-#{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 |