middleman-ogp 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff26d501132ad5d6aff88ce5c3936b799bb8c6f8
4
- data.tar.gz: 0c09e35c94c5490cfd23596718fa8d7241616d41
3
+ metadata.gz: f91b8d69604327632bb876cc9ccfd921513ecb85
4
+ data.tar.gz: f982b94be6a8e920f7340c7347fbdae7af3f1424
5
5
  SHA512:
6
- metadata.gz: 35619f2a12782f18cc02b137fef74ebb93aab5bafe5ee6794708717349c0ef926e79d0ad52b3fc31e3d470863da5bd8ed3005a2a986f81e1078c0741770adb83
7
- data.tar.gz: d2f2eb7474c5edc6533d48c95148cd1300c2810142cf04e29345d71868b3190e76b92433fe10e913f0e3060fbafb66960cc103f15a210b36bd1fe709bf14a1c9
6
+ metadata.gz: 056abc90640be38e8aa34d97363f34b8326887456cb9b87e0bce68a76781e33df48d3094e4fff448bb2241761fd6dee4714bcc5e6da2083eefefd6793d042bc2
7
+ data.tar.gz: f115d3ad9d4faedaebe6bbcd6041f00c0280f295aba75baeeeeb15f1c5fdfadbfe0beabb0ea590f6748d34e753874f75f8206d7ed31c5930ce374e48d6c3a79e
@@ -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" />'
@@ -1,5 +1,6 @@
1
1
  PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
2
  ENV['TEST'] = 'true'
3
+ ENV['TZ'] = 'UTC'
3
4
  require "middleman-core"
4
5
  require "middleman-blog"
5
6
  require "middleman-core/step_definitions"
@@ -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')
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module OGP
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
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.2.0
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: 2017-11-10 00:00:00.000000000 Z
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: