middleman-meta-tags 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -7
- data/lib/middleman-meta-tags/helpers.rb +2 -0
- data/lib/middleman-meta-tags/version.rb +1 -1
- data/spec/middleman-meta-tags/helpers_spec.rb +29 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4136f9598fca0724748c1db041a36bbd41f57e734abe96ded4e2c2595e9765c2
|
4
|
+
data.tar.gz: 9cd54689e62522011bdb968b8e140f365310c1475ce25d4a39a9b71c88b9f874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 289ab13ebc08cfef692870033b05efb9adc7ccda75f3904409f46f0285e96ea4f60bd5cca6a6b0c540f7103e214f895e4af4f91525990267e8c5c8b5d61e40a5
|
7
|
+
data.tar.gz: ea93d7c51a5a40d0ea1d94c6a1e740ef3a1d2f4ffdb8b39cacec8d067632252166be86ac1eb0ea7fde1f2e480b836d988a935d1b644124f0394501e06e703e04
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Middleman MetaTags
|
1
|
+
# Middleman MetaTags [![Ruby](https://github.com/tiste/middleman-meta-tags/actions/workflows/ruby.yml/badge.svg)](https://github.com/tiste/middleman-meta-tags/actions/workflows/ruby.yml)
|
2
2
|
|
3
3
|
SEO gem for your Middleman apps.
|
4
4
|
|
@@ -87,14 +87,14 @@ Then it looks the page meta data to attempt to display the following keys:
|
|
87
87
|
- MM `twitter_card` (defaults to `summary_large_image`) => META `twitter:card`
|
88
88
|
- MM `twitter_author` => META `twitter:creator`
|
89
89
|
- MM `description` => META `twitter:description`
|
90
|
-
- MM `
|
90
|
+
- MM `thumbnail` => META `twitter:image:src`
|
91
91
|
- MM `publisher_twitter` => META `twitter:site`
|
92
92
|
- MM `title` => META `twitter:title`
|
93
93
|
- MM `description` => META `og:description`
|
94
|
-
- MM `
|
94
|
+
- MM `thumbnail` => META `og:image`
|
95
95
|
- MM `site` => META `og:site_name`
|
96
96
|
- MM `title` => META `og:title`
|
97
|
-
- MM `host` => optional attribute for composing `
|
97
|
+
- MM `host` => optional attribute for composing `thumbnail` src with asset helper
|
98
98
|
|
99
99
|
In addition, if you want to customize meta tags by each page's frontmatter, you
|
100
100
|
can add `customize_by_frontmatter: true` in `data/site.yml`. The priority would
|
@@ -116,10 +116,10 @@ And add it to the layouts and views that you need.
|
|
116
116
|
|
117
117
|
### Pull images
|
118
118
|
|
119
|
-
For the `
|
119
|
+
For the `thumbnail` to render for twitter metatags, a full url must be used:
|
120
120
|
|
121
121
|
```
|
122
|
-
|
122
|
+
thumbnail: 'http://example.com/path/to/image.jpg'
|
123
123
|
```
|
124
124
|
|
125
125
|
If pointing to an image in your Middleman source, you can instead specify the
|
@@ -133,7 +133,7 @@ metatags.
|
|
133
133
|
host: http://example.com
|
134
134
|
|
135
135
|
# your article
|
136
|
-
|
136
|
+
thumbnail 'page/to/image/jpg'
|
137
137
|
```
|
138
138
|
|
139
139
|
## Contributing
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
+
require 'middleman-core/core_extensions/data'
|
4
|
+
|
3
5
|
describe Middleman::MetaTags::Helpers do
|
4
6
|
let(:h) { Class.new { extend Middleman::MetaTags::Helpers } }
|
5
7
|
|
@@ -86,4 +88,31 @@ describe Middleman::MetaTags::Helpers do
|
|
86
88
|
).to be_nil
|
87
89
|
end
|
88
90
|
end
|
91
|
+
|
92
|
+
describe "site_data" do
|
93
|
+
before do
|
94
|
+
app = :app
|
95
|
+
data_store = Middleman::CoreExtensions::Data::DataStore.new(
|
96
|
+
app,
|
97
|
+
Middleman::CoreExtensions::Data::DATA_FILE_MATCHER
|
98
|
+
)
|
99
|
+
data_store.store(
|
100
|
+
:site,
|
101
|
+
{
|
102
|
+
:host => "https://middlemanapp.com/",
|
103
|
+
:site => "Middleman",
|
104
|
+
}
|
105
|
+
)
|
106
|
+
allow(h).to receive(:data).and_return(data_store)
|
107
|
+
end
|
108
|
+
|
109
|
+
it "returns a HashWithIndifferentAccess" do
|
110
|
+
expect(h.site_data).to be_a(ActiveSupport::HashWithIndifferentAccess)
|
111
|
+
end
|
112
|
+
|
113
|
+
it "returns data from the :site key" do
|
114
|
+
expect(h.site_data['site']).to eq("Middleman")
|
115
|
+
expect(h.site_data[:site]).to eq("Middleman")
|
116
|
+
end
|
117
|
+
end
|
89
118
|
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.
|
4
|
+
version: 0.7.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:
|
11
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|