jekyll_icon_list 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 646c55e10cdc07ca2648f30a38f84283f54a0106ac50caebbfdb672202ae3a03
4
- data.tar.gz: dbfb66532092ff44ba10afe9059683d953152989a84e13cddf1489cc0c6a0dce
3
+ metadata.gz: 8a60ed45a09b734b3d762d3342f6b5528556c000da6e604dbb48e846ccb8ef50
4
+ data.tar.gz: f471b5f36c4e041bae6908df8e24868ae1b4618570d4255419a7ad9be9fc03c6
5
5
  SHA512:
6
- metadata.gz: cc866f244d2846fcb9c0699591895b305da662a569079b22fdb031cd83756063d2859060b4b9b1bc77bb573eb70fc136c33c022f67e57ad1e815bab666d3c175
7
- data.tar.gz: e2e450f350c7644ded463974b2fc0d99833c756626bd4d7f4722fa19245d9bd4092467264503fb4e9210ca8205eeb742341773c0de81e7a49bfbdb048c39687d
6
+ metadata.gz: 47a56c8641cc3902a4ab5b91358107207134f7a4da5faef2bcc50d221f9a6fbb39312ecf28846163264a69fbf38bb09649163731c327f7049cbc3885433dd224
7
+ data.tar.gz: 9b21dbd748841adfcc489f21c1f47c4954851d59251fed0409d7423f59369a15596ee0e69fecf41afaf3dc61f43b0721d499e60b1a5ff95ec3fc09a607f99005
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'rake', '~> 10.0'
30
30
 
31
31
  spec.add_dependency 'jekyll-inline-svg'
32
- spec.add_dependency 'objective_elements', '~>0.2.0'
32
+ spec.add_dependency 'objective_elements', '~>1.0.0'
33
33
  end
@@ -30,12 +30,12 @@ module JekyllIconList
30
30
  def render(context)
31
31
  @context = context
32
32
 
33
- site_settings = @context.registers[:site]
34
- raise 'could not load website configuration data' unless site_settings
33
+ site = @context.registers[:site]
34
+ raise 'could not load website configuration data' unless site
35
35
 
36
- @icon_list_settings = site_settings.config['icon_list'] || {}
36
+ @icon_list_settings = site.config['icon_list'] || {}
37
37
 
38
- all_items_data = site_settings.data['icon_list'] || {}
38
+ all_items_data = site.data['icon_list'] || {}
39
39
 
40
40
  build_settings
41
41
 
@@ -50,7 +50,7 @@ module JekyllIconList
50
50
 
51
51
  # raw_input will look something like this:
52
52
  # 'item1 item2 item3 --ul attribute="value" --(...)'
53
- raw_input_array = liquid_parse(@raw_input).split('--').map do |i|
53
+ raw_input_array = liquid_parse(@raw_input).split(' --').map do |i|
54
54
  i.strip.split(' ')
55
55
  end
56
56
 
@@ -78,7 +78,7 @@ module JekyllIconList
78
78
 
79
79
  label = build_label(n, this_item_data)
80
80
 
81
- list.add_content build_li(this_item_data, icon_location, label)
81
+ list << build_li(this_item_data, icon_location, label)
82
82
  end
83
83
 
84
84
  list.to_s
@@ -121,11 +121,12 @@ module JekyllIconList
121
121
  )
122
122
  return li unless this_item_data['url']
123
123
 
124
- li.reset_content build_anchor(this_item_data['url'], li.content)
124
+ li.content = build_anchor(this_item_data['url'], li.content)
125
+ li
125
126
  end
126
127
 
127
128
  def build_image_tag(icon_filename)
128
- if icon_filename.split('.').pop.casecmp('svg').zero?
129
+ if File.extname(icon_filename).casecmp('.svg').zero?
129
130
  build_svg(icon_filename)
130
131
  else
131
132
  build_img(icon_filename)
@@ -140,14 +141,17 @@ module JekyllIconList
140
141
  end
141
142
 
142
143
  def build_img(icon_filename)
143
- img = SingleTag.new 'img', attributes: { src: icon_filename }
144
- img.add_attributes @attributes['img'] if @attributes['img']
144
+ img = SingleTag.new 'img'
145
+ img.src = icon_filename
146
+ img.attributes << @attributes['img']
147
+ img
145
148
  end
146
149
 
147
150
  def build_anchor(url, content)
148
- a = DoubleTag.new 'a', attributes: { href: url }, oneline: true
149
- a.add_content content
150
- a.add_attributes @attributes['a'] if @attributes['a']
151
+ a = DoubleTag.new 'a', oneline: true
152
+ a.href = url
153
+ a << content
154
+ a.attributes << @attributes['a']
151
155
  a
152
156
  end
153
157
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllIconList
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.6.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_icon_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Buchberger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2018-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.2.0
75
+ version: 1.0.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.2.0
82
+ version: 1.0.0
83
83
  description:
84
84
  email:
85
85
  - robert@robert-buchberger.com