middleman-meta-tags 0.1.3 → 0.2.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: 82257b5fe8995b6feda0362ca1f3fac4bb75a8ad
4
- data.tar.gz: 4e6b757305bb3d46d9a7020a5855889928424a0c
3
+ metadata.gz: a6b5508919401357afff08347fbb15c8492c6f8f
4
+ data.tar.gz: e7208180d65aa063c36a3acaffda2e0660756ad2
5
5
  SHA512:
6
- metadata.gz: 05f1ea4d02707b13e5869d6084adc087bb752cb6b6462e35b2a76599fedd1329bd27e57d2e220765c6c952a5645713cf92a73a71cd1af9085dd95513aa3a2c7c
7
- data.tar.gz: 7726c4f903c1b6a3216587d100e14b72dbd721aeb9d47762d394cf1cf7c650ff5cde952184ad75c42edb1488022bf487b6dff4eb7d9345c6483c558e427704f3
6
+ metadata.gz: f0f24f7206d6de484d69b514eb099f1c6bfd2ae029bf8c9bb3a27b952753d50e1e84eb02927cce76cc7d99f3a8c304074b6255c729d5fc08e766c65e54a978f7
7
+ data.tar.gz: 9c1003785ae089d120d1ee111086d75ad116ff992f324b3689c6bc94e596f0c4d1256c2e817b61153a4683f7eb33adf84b18fe60f9fce2c35c515479a6862938
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Next release
2
2
 
3
+ ## 0.2.0 (03/30/16)
4
+
5
+ * Allow gem to work with middleman 4.0
6
+
3
7
  ## 0.1.3 (04/30/15)
4
8
 
5
9
  * Fix `og:` tag syntax
data/README.md CHANGED
@@ -87,6 +87,10 @@ Then it looks the page meta data to attempt to display the following keys:
87
87
  - MM `site` => META `og:site_name`
88
88
  - MM `title` => META `og:title`
89
89
 
90
+ In addition, if you want to customize meta tags by each page's frontmatter, you
91
+ can add `customize_by_frontmatter: true` in `data/site.yml`. The priority would
92
+ be set_meta_tags > frontmatter > site wide defaults.
93
+
90
94
  ### Manually adding addition tags
91
95
 
92
96
  Create a helper method inside of your config.rb, like so
@@ -1,11 +1,7 @@
1
1
  require 'middleman-meta-tags/helpers'
2
2
 
3
3
  module Middleman
4
- module MetaTags
5
- class << self
6
- def registered(app, options_hash = {}, &block)
7
- app.helpers Middleman::MetaTags::Helpers
8
- end
9
- end
4
+ class MetaTagsExtension < Extension
5
+ self.defined_helpers = [Middleman::MetaTags::Helpers]
10
6
  end
11
7
  end
@@ -81,7 +81,11 @@ module Middleman
81
81
  private
82
82
 
83
83
  def fall_through(site_data, name, key, default = nil)
84
- value = self.meta_tags[key] || site_data[key] || default
84
+ need_customized = site_data[:customize_by_frontmatter]
85
+ value = self.meta_tags[key] ||
86
+ (need_customized && current_page.data[key]) ||
87
+ site_data[key] ||
88
+ default
85
89
  set_meta_tags name => value unless value.blank?
86
90
  value
87
91
  end
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module MetaTags
3
- VERSION = '0.1.3'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -2,5 +2,5 @@ require 'middleman-core'
2
2
 
3
3
  ::Middleman::Extensions.register(:meta_tags) do
4
4
  require 'middleman-meta-tags/extension'
5
- ::Middleman::MetaTags
5
+ ::Middleman::MetaTagsExtension
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-meta-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Baptiste Lecocq
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.4.1
94
+ rubygems_version: 2.4.6
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Meta tags for Middleman