aboutsummaryrefslogtreecommitdiffstats
path: root/library/font_awesome/src/_plugins
diff options
context:
space:
mode:
authorTreer <treer.git@the-bordello.com>2016-04-30 21:36:19 +1000
committerTreer <treer.git@the-bordello.com>2016-04-30 21:36:19 +1000
commit45654ffc5cc4532c2189c88d46a0374038b53c9f (patch)
treefc1c9949dcabd360c120d318c9fe3181d47c8f42 /library/font_awesome/src/_plugins
parent931a4fafe316b23bacf92ac1ff35f9b8467415dd (diff)
downloadvolse-hubzilla-45654ffc5cc4532c2189c88d46a0374038b53c9f.tar.gz
volse-hubzilla-45654ffc5cc4532c2189c88d46a0374038b53c9f.tar.bz2
volse-hubzilla-45654ffc5cc4532c2189c88d46a0374038b53c9f.zip
update font-awesome library to 4.6.1
Perhaps this should be done as a submodule instead?
Diffstat (limited to 'library/font_awesome/src/_plugins')
-rw-r--r--library/font_awesome/src/_plugins/flatten_icon_filters.rb38
-rw-r--r--library/font_awesome/src/_plugins/icon_page_generator.rb3
2 files changed, 39 insertions, 2 deletions
diff --git a/library/font_awesome/src/_plugins/flatten_icon_filters.rb b/library/font_awesome/src/_plugins/flatten_icon_filters.rb
new file mode 100644
index 000000000..1e3daff80
--- /dev/null
+++ b/library/font_awesome/src/_plugins/flatten_icon_filters.rb
@@ -0,0 +1,38 @@
+##
+# Flattens the icons object to a one-dimensional array of possible search terms.
+
+require 'set'
+
+module Jekyll
+ module FlattenArray
+ def flattenIconFilters(icons)
+ flattened = Set.new
+ icons.each do |icon|
+ toAdd = []
+
+ toAdd.push(icon["class"].downcase) # Add class as a filter value
+
+ # Add any existing aliases as a filter value
+ if not icon["aliases"].nil?
+ icon["aliases"].each do |iconAlias|
+ toAdd.push(iconAlias.downcase)
+ end
+ end
+
+ # Add any existing filters as a filter value
+ if not icon["filter"].nil?
+ icon["filter"].each do |iconFilter|
+ toAdd.push(iconFilter.downcase)
+ end
+ end
+ flattened.merge(toAdd)
+
+ print toAdd if toAdd.include? true
+ print toAdd if toAdd.include? false
+ end
+ return flattened.to_a # .to_a because we can't jsonify a <Set>
+ end
+ end
+end
+
+Liquid::Template.register_filter(Jekyll::FlattenArray)
diff --git a/library/font_awesome/src/_plugins/icon_page_generator.rb b/library/font_awesome/src/_plugins/icon_page_generator.rb
index 51475e540..32b7cd428 100644
--- a/library/font_awesome/src/_plugins/icon_page_generator.rb
+++ b/library/font_awesome/src/_plugins/icon_page_generator.rb
@@ -2,7 +2,6 @@
# Create individual pages for each icon in the FontAwesome set
require 'yaml'
-require 'debugger'
module Jekyll
@@ -23,7 +22,7 @@ module Jekyll
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']
+ self.data['title'] = "fa-#{icon.id}: " + self.data['title_suffix']
end
end