jekyll-bits 0.13 → 0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jekyll-bits.gemspec +1 -1
- data/lib/jekyll-bits/picture.rb +5 -1
- data/test/test_picture.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 122342a2c6700b64c568ff83f4b96b6840194697
|
4
|
+
data.tar.gz: 317fc9bf12f3ffc3db8b835f677efd70cfd81085
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7887e9e68115a34ba7785215153050a645ee850088e496b54b71f14d5bea5bbd368882dfc0a5c79ca370653d5c9dfc185378803c7623c672c32f6c27ed83574b
|
7
|
+
data.tar.gz: 464fb8e889306f29c1ed9624a7d1374fe42cba80fb630e72f7b1defa47eeaa241e01700dbf3938550ba0e9fb0afa4341b2fafd64407b43f8270dce1922d8f3e2
|
data/jekyll-bits.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.rubygems_version = '2.2.2'
|
9
9
|
s.required_ruby_version = '>= 1.9.3'
|
10
10
|
s.name = 'jekyll-bits'
|
11
|
-
s.version = '0.
|
11
|
+
s.version = '0.14'
|
12
12
|
s.license = 'MIT'
|
13
13
|
s.summary = 'Jekyll Bits'
|
14
14
|
s.description = 'Useful and very simple Jekyll plugins'
|
data/lib/jekyll-bits/picture.rb
CHANGED
@@ -32,7 +32,7 @@ module Jekyll
|
|
32
32
|
# All our custom filters
|
33
33
|
module JbFilters
|
34
34
|
def jb_picture_head(page)
|
35
|
-
uri = uri(page)
|
35
|
+
uri = abs(uri(page))
|
36
36
|
return '' if uri.empty?
|
37
37
|
html = "<meta name='og:image' content='#{CGI.escapeElement(uri)}'/>"
|
38
38
|
html += "<meta name='twitter:image' content='#{CGI.escapeElement(uri)}'/>"
|
@@ -97,6 +97,10 @@ content='#{CGI.escapeHTML(alt(page))}'/>"
|
|
97
97
|
uri = yaml
|
98
98
|
end
|
99
99
|
end
|
100
|
+
uri.to_s
|
101
|
+
end
|
102
|
+
|
103
|
+
def abs(uri)
|
100
104
|
unless uri.empty?
|
101
105
|
uri = URI.parse(uri)
|
102
106
|
uri = home + uri.to_s unless %w(http https).include?(uri.scheme)
|
data/test/test_picture.rb
CHANGED
@@ -97,7 +97,7 @@ module Jekyll
|
|
97
97
|
)
|
98
98
|
assert_match(/figcaption/, html)
|
99
99
|
assert_match(/figure/, html)
|
100
|
-
assert_match(/<figcaption id='
|
100
|
+
assert_match(/<figcaption id='d9d1da45'>it is <simple>/, html)
|
101
101
|
assert_match(/alt='nothing 'to' say'/, html)
|
102
102
|
assert_match(/width='500'/, html)
|
103
103
|
end
|