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 +4 -4
- data/jekyll_icon_list.gemspec +1 -1
- data/lib/jekyll_icon_list.rb +17 -13
- data/lib/jekyll_icon_list/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a60ed45a09b734b3d762d3342f6b5528556c000da6e604dbb48e846ccb8ef50
|
4
|
+
data.tar.gz: f471b5f36c4e041bae6908df8e24868ae1b4618570d4255419a7ad9be9fc03c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47a56c8641cc3902a4ab5b91358107207134f7a4da5faef2bcc50d221f9a6fbb39312ecf28846163264a69fbf38bb09649163731c327f7049cbc3885433dd224
|
7
|
+
data.tar.gz: 9b21dbd748841adfcc489f21c1f47c4954851d59251fed0409d7423f59369a15596ee0e69fecf41afaf3dc61f43b0721d499e60b1a5ff95ec3fc09a607f99005
|
data/jekyll_icon_list.gemspec
CHANGED
data/lib/jekyll_icon_list.rb
CHANGED
@@ -30,12 +30,12 @@ module JekyllIconList
|
|
30
30
|
def render(context)
|
31
31
|
@context = context
|
32
32
|
|
33
|
-
|
34
|
-
raise 'could not load website configuration data' unless
|
33
|
+
site = @context.registers[:site]
|
34
|
+
raise 'could not load website configuration data' unless site
|
35
35
|
|
36
|
-
@icon_list_settings =
|
36
|
+
@icon_list_settings = site.config['icon_list'] || {}
|
37
37
|
|
38
|
-
all_items_data =
|
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
|
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.
|
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
|
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'
|
144
|
-
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',
|
149
|
-
a.
|
150
|
-
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
|
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.
|
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-
|
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.
|
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.
|
82
|
+
version: 1.0.0
|
83
83
|
description:
|
84
84
|
email:
|
85
85
|
- robert@robert-buchberger.com
|