middleman-ogp 1.2.0 → 1.3.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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f91b8d69604327632bb876cc9ccfd921513ecb85
|
|
4
|
+
data.tar.gz: f982b94be6a8e920f7340c7347fbdae7af3f1424
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 056abc90640be38e8aa34d97363f34b8326887456cb9b87e0bce68a76781e33df48d3094e4fff448bb2241761fd6dee4714bcc5e6da2083eefefd6793d042bc2
|
|
7
|
+
data.tar.gz: f115d3ad9d4faedaebe6bbcd6041f00c0280f295aba75baeeeeb15f1c5fdfadbfe0beabb0ea590f6748d34e753874f75f8206d7ed31c5930ce374e48d6c3a79e
|
data/features/blog.feature
CHANGED
|
@@ -14,6 +14,13 @@ Feature: Middleman Blog support
|
|
|
14
14
|
Then I should see '<meta content="2014-04-12T04:00:00Z" property="article:published_time" />'
|
|
15
15
|
Then I should see '<meta content="ruby" property="article:tag" />'
|
|
16
16
|
Then I should see '<meta content="middleman" property="article:tag" />'
|
|
17
|
+
Then I should see '<meta content="Test" property="article:author:first_name" />'
|
|
18
|
+
Then I should see '<meta content="Author" property="article:author:last_name" />'
|
|
19
|
+
Then I should see '<meta content="test_author" property="article:author:username" />'
|
|
20
|
+
Then I should see '<meta content="female" property="article:author:gender" />'
|
|
21
|
+
Then I should see '<meta content="Test Section" property="article:section" />'
|
|
22
|
+
Then I should see '<meta content="2014-04-13T03:00:00Z" property="article:modified_time" />'
|
|
23
|
+
Then I should see '<meta content="2018-04-12T04:00:00Z" property="article:expiration_time" />'
|
|
17
24
|
Then I should see '<meta content="blog" property="article:tag" />'
|
|
18
25
|
Then I should see '<meta content="http://myblog.foo.tld/2014/04/12/my-test.html" property="og:url" />'
|
|
19
26
|
Then I should see '<meta content="Fixture page" property="og:title" />'
|
data/features/support/env.rb
CHANGED
|
@@ -3,6 +3,14 @@ title: Fixture page
|
|
|
3
3
|
description: This is a ficture page
|
|
4
4
|
tags: ruby, middleman, blog
|
|
5
5
|
date: 2014-04-12 04:00
|
|
6
|
+
author:
|
|
7
|
+
first_name: Test
|
|
8
|
+
last_name: Author
|
|
9
|
+
username: test_author
|
|
10
|
+
gender: female
|
|
11
|
+
section: Test Section
|
|
12
|
+
modified_time: 2014-04-13 03:00
|
|
13
|
+
expiration_time: 2018-04-12 04:00
|
|
6
14
|
---
|
|
7
15
|
|
|
8
16
|
h1 Hello article
|
|
@@ -33,6 +33,25 @@ module Middleman
|
|
|
33
33
|
tag: current_article.tags,
|
|
34
34
|
}
|
|
35
35
|
})
|
|
36
|
+
if current_article.data.section
|
|
37
|
+
opts[:article][:section] = current_article.data.section
|
|
38
|
+
end
|
|
39
|
+
if current_article.data.expiration_time
|
|
40
|
+
opts[:article][:expiration_time] = Time.parse(current_article.data.expiration_time).utc.iso8601
|
|
41
|
+
end
|
|
42
|
+
if current_article.data.modified_time
|
|
43
|
+
opts[:article][:modified_time] = Time.parse(current_article.data.modified_time).utc.iso8601
|
|
44
|
+
end
|
|
45
|
+
if current_article.data.author
|
|
46
|
+
if current_article.data.author.kind_of?(Object)
|
|
47
|
+
opts[:article][:author] = {}
|
|
48
|
+
[:first_name, :last_name, :username, :gender].each do | field |
|
|
49
|
+
if current_article.data.author[field]
|
|
50
|
+
opts[:article][:author][field] = current_article.data.author[field]
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
36
55
|
end
|
|
37
56
|
opts[:og] ||= {}
|
|
38
57
|
if Middleman::OGP::Helper.auto.include?('title')
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: middleman-ogp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Atsushi Nagase
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: middleman-core
|
|
@@ -104,4 +104,3 @@ test_files:
|
|
|
104
104
|
- fixtures/test-blog/source/layout.slim
|
|
105
105
|
- spec/helper_spec.rb
|
|
106
106
|
- spec/spec_helper.rb
|
|
107
|
-
has_rdoc:
|