Module: Jekyll::IconFilters

Defined in:
lib/irontask/public/components/font-awesome/src/_plugins/site.rb

Instance Method Summary collapse

Instance Method Details

#category(icons, cat) ⇒ Object



84
85
86
# File 'lib/irontask/public/components/font-awesome/src/_plugins/site.rb', line 84

def category(icons, cat)
  icons.select { |icon| icon['categories'].include?(cat) }
end

#expand_aliases(icons) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/irontask/public/components/font-awesome/src/_plugins/site.rb', line 65

def expand_aliases(icons)
  expanded = []

  icons.each { |icon|
    # Remove the aliases since we are expanding them
    expanded << icon.reject{ |k| k == 'aliases'}

    icon['aliases'].each { |alias_id|
      alias_icon = expanded[-1].dup
      alias_icon['class'] = alias_id
      alias_icon['alias_of'] = icon

      expanded << alias_icon
    }
  }

  return expanded
end

#sort_by(icons, sort_key) ⇒ Object



92
93
94
# File 'lib/irontask/public/components/font-awesome/src/_plugins/site.rb', line 92

def sort_by(icons, sort_key)
  icons.sort_by! { |icon| icon[sort_key] }
end

#version(icons, version) ⇒ Object



88
89
90
# File 'lib/irontask/public/components/font-awesome/src/_plugins/site.rb', line 88

def version(icons, version)
  icons.select { |icon| icon['created'] == version }
end