middleman-meta-tags 0.5.0 → 0.6.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
  SHA256:
3
- metadata.gz: 59169e69789518c47ce31641beab6af4880726df72a26ab5941b254a7b5dca37
4
- data.tar.gz: 74d48cfd537a22182d15698f131e56a9b12f796ac6d3d7f3fe9f9154b60c0980
3
+ metadata.gz: ef14ab4f61e2d7198851cc0808879c8c3430a9bcdc2859da4ce1a0f1f013cdd4
4
+ data.tar.gz: e8f9404f1345214f339ca1c4c67c707fa5a2d8cdbae6e046b9d2ec3151c73685
5
5
  SHA512:
6
- metadata.gz: 20ffc6fcaa9b666ab2c85afd5f2ce0d30dc95bc32fae5fc3ccfe957239d239fc8ee9f91d160931aac9d4fef1937f8200d877eaa5e616f3cebeab75fff23d37c1
7
- data.tar.gz: 6695dd19fd1cc06da7da79831d90147d64441e30c54b534d1e04898f20bf538d087f15c5c6f884f66433d549bde7d89c06b47279fc68e5675413871764bb7207
6
+ metadata.gz: e288243971af0448eb3da675e580a1c5eb27621518c5d38f3823dca6780cfa2463cb508761d960ff4c6b1204df7e01d72b9eaf6691a5b392ea8cea9b3c7dc1bf
7
+ data.tar.gz: 3bfdfb8894575caf3f8530c096355d72e24e24e59d9da63f26e36e9deb2385ed191fa4104c8bcdbf7d4e9decf359b515c9cfc1ad7418aa9e2198d8827913f957
@@ -1 +1 @@
1
- 2.2
1
+ ruby-2.6.2
@@ -1,3 +1,9 @@
1
+ ## 0.6.0 (11/03/20)
2
+
3
+ * Allow viewport to be customized
4
+ * Add ability to not have images in meta data
5
+ * Use a newer version of Ruby
6
+
1
7
  ## 0.5.0 (08/01/20)
2
8
 
3
9
  * Description truncate to 220 chars
data/README.md CHANGED
@@ -146,5 +146,6 @@ pull_image 'page/to/image/jpg'
146
146
 
147
147
  ## Publishing
148
148
 
149
- 1. `gem build middleman-meta-tags.gemspec`
150
- 2. `bundle exec rake release`
149
+ 1. Update `./lib/middleman-meta-tags/version.rb` and CHANGELOG.md
150
+ 2. `gem build middleman-meta-tags.gemspec`
151
+ 3. `bundle exec rake release`
@@ -106,7 +106,6 @@ module Middleman
106
106
  author_data = site_data['author'] || {}
107
107
 
108
108
  set_meta_tags charset: 'utf-8',
109
- viewport: 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no',
110
109
  'http-equiv': 'IE=edge,chrome=1'
111
110
 
112
111
  fall_through(site_data, :site, 'name')
@@ -114,6 +113,7 @@ module Middleman
114
113
  fall_through(site_data, :title, 'title')
115
114
  fall_through(site_data, :description, 'description')
116
115
  fall_through(site_data, :keywords, 'keywords')
116
+ fall_through(site_data, :viewport, 'viewport', 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no')
117
117
 
118
118
  # Microdata
119
119
  fall_through(site_data, 'itemprop:name', 'name')
@@ -203,6 +203,7 @@ module Middleman
203
203
  end
204
204
 
205
205
  def meta_tags_image_url(source)
206
+ return nil unless source.present?
206
207
  File.join(meta_tags_host, image_path(source))
207
208
  end
208
209
 
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module MetaTags
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'
4
4
  end
5
5
  end
@@ -34,4 +34,56 @@ describe Middleman::MetaTags::Helpers do
34
34
  expect(h.display_meta_tags site: 'My Awesome Website').to eql('<title>My Awesome Website</title>
35
35
  <link rel="site" href="My Awesome Website" />')
36
36
  end
37
+
38
+ describe "auto_display_meta_tags" do
39
+ before do
40
+ allow(h).to receive(:data).and_return({})
41
+ end
42
+
43
+ it "includes a viewport tag" do
44
+ tags = h.auto_display_meta_tags.split("\n")
45
+ expect(tags).to include(
46
+ '<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />'
47
+ )
48
+ end
49
+
50
+ it "prefers viewport from site data" do
51
+ allow(h).to receive(:data).and_return(
52
+ {
53
+ "site" => {
54
+ "viewport" => "width=device-width,user-scalable=yes"
55
+ }
56
+ }
57
+ )
58
+
59
+ tags = h.auto_display_meta_tags.split("\n")
60
+ expect(tags).to include(
61
+ '<meta name="viewport" content="width=device-width,user-scalable=yes" />'
62
+ )
63
+ end
64
+ end
65
+
66
+ describe "meta_tags_image_url" do
67
+ before do
68
+ allow(h).to receive(:data).and_return(
69
+ {
70
+ "site" => {
71
+ "host" => "https://example.com"
72
+ }
73
+ }
74
+ )
75
+ end
76
+
77
+ it "returns a URL when image is given" do
78
+ expect(
79
+ h.send(:meta_tags_image_url, "/awesome/image.jpg")
80
+ ).to eq("https://example.com/awesome/image.jpg")
81
+ end
82
+
83
+ it "returns nil when image is nil" do
84
+ expect(
85
+ h.send(:meta_tags_image_url, nil)
86
+ ).to be_nil
87
+ end
88
+ end
37
89
  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.5.0
4
+ version: 0.6.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: 2020-08-01 00:00:00.000000000 Z
11
+ date: 2020-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core