jekyll-bits 0.10 → 0.11
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 +8 -2
- data/test/test_picture.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dff4c198c29671f9e82d985e6f8776105ac8e51
|
4
|
+
data.tar.gz: b8298a9b0df0f362fad5804a9e92ecdb5c5431ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e21c6aaad88434cbf846e10f2ff513cb68b72f2cce1f7092004b058e72c2f1500a3923a8525014883203501b5b5dc262686bbb849e52b662cf46c227c4a6f94
|
7
|
+
data.tar.gz: 2f537d508ab083f18d074517ac0d5aa67132675be594f78e7f3ddb16728db4867e891c8735e38aaba95e01d6a3c72b53fdb7d8f6ec43e93e6978ab3d7f1228cd
|
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.11'
|
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
@@ -40,8 +40,14 @@ module Jekyll
|
|
40
40
|
path = File.join(Dir.pwd, path) unless \
|
41
41
|
%w(http https).include?(URI.parse(uri).scheme)
|
42
42
|
width, height = FastImage.size(path)
|
43
|
-
|
44
|
-
|
43
|
+
if width
|
44
|
+
html += "<meta name='og:image:width' content='#{width}'/>
|
45
|
+
<meta name='twitter:image:width' content='#{width}'/>"
|
46
|
+
end
|
47
|
+
if height
|
48
|
+
html += "<meta name='og:image:height' content='#{height}'/>
|
49
|
+
<meta name='twitter:image:height' content='#{height}'/>"
|
50
|
+
end
|
45
51
|
html
|
46
52
|
end
|
47
53
|
|
data/test/test_picture.rb
CHANGED
@@ -56,6 +56,8 @@ module Jekyll
|
|
56
56
|
assert_match(/meta/, html)
|
57
57
|
assert_contains("<meta name='og:image:width' content='1280'/>", html)
|
58
58
|
assert_contains("<meta name='og:image:height' content='543'/>", html)
|
59
|
+
assert_contains("<meta name='twitter:image:width' content='1280'/>", html)
|
60
|
+
assert_contains("<meta name='twitter:image:height' content='543'/>", html)
|
59
61
|
end
|
60
62
|
|
61
63
|
def test_generates_html_simple_body
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-bits
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.11'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|