lib/jekyll_icon_list.rb
def build_settings
      @attributes = @icon_list_settings['defaults'].dup || {}
      # {'ul' => 'class="awesome" (...)', (...)}

      # raw_input will look something like this:
      # 'item1 item2 item3 --ul attribute="value" --(...)'
      raw_input_array = liquid_parse(@raw_input).split(' --').map do |i|
        i.strip.split(' ')
      end

      # [['item1', 'item2', 'item3'], ['ul', 'attr="value', 'value2"'],(...)]

      @item_shortnames = raw_input_array.shift
      # item_shortnames = ['item1', 'item2', 'item3']
      # raw_input_array = ['ul, 'attribute="value1 value2"', (...)]

      raw_input_array.each { |a| @attributes[a.shift] = a.join ' ' }
      # {'ul' => 'attribute="value1 value2 value3"'}
    end
# Used for finding liquid variables in input
Used for finding liquid variables in input
Used for finding liquid variables in input
def build_settings
      @attributes = @icon_list_settings['defaults'].dup || {}
      raw_input_array = liquid_parse(@raw_input).split(' --').map do |i|
        i.strip.split(' ')
      end
      @item_shortnames = raw_input_array.shift
      raw_input_array.each { |a| @attributes[a.shift] = a.join ' ' }
    end
def build_settings @attributes = @icon_list_settings [ 'defaults' ] . dup || { } raw_input_array = liquid_parse ( @raw_input ) . split ( ' --' ) . map do | i | i . strip . split ( ' ' ) end @item_shortnames = raw_input_array . shift raw_input_array . each { | a | @attributes [ a . shift ] = a . join ' ' } end
Used for finding liquid variables in input
Used for finding liquid variables in input
# {'ul' => 'class="awesome" (...)', (...)} # raw_input will look something like this: # 'item1 item2 item3 --ul attribute="value" --(...)' # [['item1', 'item2', 'item3'], ['ul', 'attr="value', 'value2"'],(...)] # item_shortnames = ['item1', 'item2', 'item3'] # raw_input_array = ['ul, 'attribute="value1 value2"', (...)] # {'ul' => 'attribute="value1 value2 value3"'}