meta-tags 2.7.1 → 2.8.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: 3cbf0214f6d3ba9770a84ac08dc4303f20e0d726
4
- data.tar.gz: a1f5551f63cb4a585abad57c39f30e49fd1778f6
3
+ metadata.gz: 6c154acfd9aee3e03d552f48a280f283d2b1daf3
4
+ data.tar.gz: c053a4f2c0eee6dbb7f3a3ee3aae83ea2028247c
5
5
  SHA512:
6
- metadata.gz: c72b7d6871d77bb21794f44ca57e96a1af0749c81796e0a4559e6cba072b57101c9b2c7feafdfc9e519695327d0b153821ba506e7be5e4454c534883d3a32e92
7
- data.tar.gz: 2dcb87e0d686cb34072731a02ec355f09eda6e9d207d7abfa65380844489289a7ddb932a660e587902c53d0d66304db2b7a233f544f8e0693d09c2c444b96133
6
+ metadata.gz: 4f5a3d2473bac40102f8fcd84c86bff95cd9fb740ddc81118da94e4f683e969debebab8069656dea3e6de248163dc6c388d6cdab19f02bd9c97fb8f0151fcc55
7
+ data.tar.gz: 31468642280f4026434f939e838aa7d2c8e9dc9c6890ac7af5d9fee4f9aad4c624073b07ea5cdd7ec518a74462804268d89ac56b2125d31614b2b5469eb5c891
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,11 @@
1
+ ## 2.8.0 (February 28, 2018) [☰](https://github.com/kpumuk/meta-tags/compare/v2.7.1...v2.8.0)
2
+
3
+ Features:
4
+ - Added noarchive support.
5
+
6
+ Changes:
7
+ - Updated default description size to 300 as a new recommended truncation limit.
8
+
1
9
  ## 2.7.1 (February 1, 2018) [☰](https://github.com/kpumuk/meta-tags/compare/v2.7.0...v2.7.1)
2
10
 
3
11
  Changes:
data/README.md CHANGED
@@ -149,6 +149,7 @@ Use these options to customize the title format:
149
149
  * `:noindex` — add noindex meta tag; when true, 'robots' will be used, otherwise the string will be used;
150
150
  * `:nofollow` — add nofollow meta tag; when true, 'robots' will be used, otherwise the string will be used;
151
151
  * `:follow` – add follow meta tag; when true, 'robots' will be used, otherwise the string will be used;
152
+ * `:noarchive` – add noarchive meta tag; when true, 'robots' will be used, otherwise the string will be used;
152
153
  * `:canonical` — add canonical link tag;
153
154
  * `:prev` — add prev link tag;
154
155
  * `:next` — add next link tag;
@@ -301,11 +302,12 @@ set_meta_tags description: "All text about keywords, other keywords"
301
302
  # <meta name="description" content="All text about keywords, other keywords">
302
303
  ```
303
304
 
304
- Recommended description tag length: up to <b>160 characters</b>.
305
+ Recommended description tag length: up to <b>300 characters</b>.
305
306
 
306
307
  Further reading:
307
308
 
308
309
  * [Meta Description](https://moz.com/learn/seo/meta-description)
310
+ * [How Long Should Your Meta Description Be? (2018 Edition)](https://moz.com/blog/how-long-should-your-meta-description-be-2018)
309
311
 
310
312
  ### Keywords
311
313
 
@@ -7,11 +7,11 @@ MetaTags.configure do |config|
7
7
  # When true, site title will be truncated instead of title. Default is false.
8
8
  # config.truncate_site_title_first = false
9
9
 
10
- # Maximum length of the page description. Default is 160.
10
+ # Maximum length of the page description. Default is 300.
11
11
  # Set to nil or 0 to remove limits.
12
- # config.description_limit = 160
12
+ # config.description_limit = 300
13
13
 
14
- # Maxumum length of the keywords meta tag. Default is 255.
14
+ # Maximum length of the keywords meta tag. Default is 255.
15
15
  # config.keywords_limit = 255
16
16
 
17
17
  # Default separator for keywords meta tag (used when an Array passed with
@@ -64,7 +64,7 @@ module MetaTags
64
64
  def reset_defaults!
65
65
  @title_limit = 70
66
66
  @truncate_site_title_first = false
67
- @description_limit = 160
67
+ @description_limit = 300
68
68
  @keywords_limit = 255
69
69
  @keywords_separator = ', '
70
70
  @keywords_lowercase = true
@@ -142,13 +142,14 @@ module MetaTags
142
142
  nofollow_name, nofollow_value = extract_noindex_attribute(:nofollow)
143
143
  follow_name, follow_value = extract_noindex_attribute(:follow)
144
144
 
145
- if noindex_name == follow_name && (follow_value && noindex_value)
146
- { noindex_name => [noindex_value, follow_value].compact.join(', ') }
147
- elsif noindex_name == nofollow_name
148
- { noindex_name => [noindex_value, nofollow_value].compact.join(', ') }
149
- else
150
- { noindex_name => noindex_value, nofollow_name => nofollow_value }
151
- end
145
+ noindex_attributes = if noindex_name == follow_name && (follow_value && noindex_value)
146
+ { noindex_name => [noindex_value, follow_value].compact.join(', ') }
147
+ elsif noindex_name == nofollow_name
148
+ { noindex_name => [noindex_value, nofollow_value].compact.join(', ') }
149
+ else
150
+ { noindex_name => noindex_value, nofollow_name => nofollow_value }
151
+ end
152
+ append_noarchive_attribute noindex_attributes
152
153
  end
153
154
 
154
155
  protected
@@ -187,5 +188,22 @@ module MetaTags
187
188
 
188
189
  [ noindex_name, noindex_value ]
189
190
  end
191
+
192
+ # Append noarchive attribute if it present.
193
+ #
194
+ # @param [Hash<String, String>] noindex noindex attributes.
195
+ # @return [Hash<String, String>] modified noindex attributes.
196
+ #
197
+ def append_noarchive_attribute(noindex)
198
+ noarchive_name, noarchive_value = extract_noindex_attribute :noarchive
199
+ if noarchive_value
200
+ if noindex[noarchive_name].blank?
201
+ noindex[noarchive_name] = noarchive_value
202
+ else
203
+ noindex[noarchive_name] += ", #{noarchive_value}"
204
+ end
205
+ end
206
+ noindex
207
+ end
190
208
  end
191
209
  end
@@ -1,4 +1,4 @@
1
1
  module MetaTags
2
2
  # Gem version.
3
- VERSION = '2.7.1'.freeze
3
+ VERSION = '2.8.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmytro Shteflyuk
@@ -30,7 +30,7 @@ cert_chain:
30
30
  QwaoNrsQi488Dsk54YiNQWVouzfjRqEa4uUxSyKmRfQp7MNILESAOCXM+wZIxanu
31
31
  C9c9eUxgNTnHhsR3sK0QCIMwtUI=
32
32
  -----END CERTIFICATE-----
33
- date: 2018-02-01 00:00:00.000000000 Z
33
+ date: 2018-03-01 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: actionpack
metadata.gz.sig CHANGED
Binary file