jekyll-seo-tag 2.7.1 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +103 -0
- data/.github/workflows/release.yml +33 -0
- data/.github/workflows/scripts/memprof +4 -0
- data/.github/workflows/{actions → scripts}/memprof.rb +0 -0
- data/.github/workflows/third-party.yml +23 -22
- data/.rubocop.yml +24 -1
- data/.rubocop_todo.yml +34 -1
- data/History.markdown +22 -0
- data/docs/advanced-usage.md +15 -1
- data/docs/usage.md +1 -0
- data/jekyll-seo-tag.gemspec +2 -2
- data/lib/jekyll-seo-tag/author_drop.rb +4 -4
- data/lib/jekyll-seo-tag/image_drop.rb +4 -4
- data/lib/jekyll-seo-tag/json_ld_drop.rb +21 -8
- data/lib/jekyll-seo-tag/url_helper.rb +2 -2
- data/lib/jekyll-seo-tag/version.rb +1 -1
- data/lib/template.html +13 -1
- metadata +10 -8
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 723360f5c41c7258a7c5cf7d19b6d734c43333fc5da1373b04b22ee0859db6ab
|
4
|
+
data.tar.gz: 0f11d746f2167c2b54db8f041210e2a6c009be35f6f8e895203f01f039bc8915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddcb4f1218b44ce1cf0215c3cf7a53cc2f7948252cd6be37f8602a3cd98186d63387fc65f52a469277efbab201b0d342894f8bb158ca7c6d0c313548b762c3f7
|
7
|
+
data.tar.gz: bd14fd0aa9f5693f0218b1323f66dec42e8f7a0074507a7d67799abad54125492ffc6a970700c948d1a3d277e5be49940a407f41113fe9a402cffc2e481299ef
|
@@ -0,0 +1,103 @@
|
|
1
|
+
name: Continuous Integration
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
j4:
|
13
|
+
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
14
|
+
name: "Jekyll ${{ matrix.jekyll_version }} (Ruby ${{ matrix.ruby_version }})"
|
15
|
+
runs-on: 'ubuntu-latest'
|
16
|
+
env:
|
17
|
+
JEKYLL_VERSION: ${{ matrix.jekyll_version }}
|
18
|
+
strategy:
|
19
|
+
fail-fast: false
|
20
|
+
matrix:
|
21
|
+
ruby_version:
|
22
|
+
- 2.5
|
23
|
+
- 2.7
|
24
|
+
- 3.0
|
25
|
+
jekyll_version:
|
26
|
+
- "~> 4.0"
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v2
|
29
|
+
with:
|
30
|
+
fetch-depth: 5
|
31
|
+
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
32
|
+
uses: ruby/setup-ruby@v1
|
33
|
+
with:
|
34
|
+
ruby-version: ${{ matrix.ruby_version }}
|
35
|
+
bundler-cache: true
|
36
|
+
- name: Execute tests
|
37
|
+
run: bundle exec rspec
|
38
|
+
j3:
|
39
|
+
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
40
|
+
name: "Jekyll ${{ matrix.jekyll_version }} (Ruby ${{ matrix.ruby_version }})"
|
41
|
+
runs-on: 'ubuntu-latest'
|
42
|
+
env:
|
43
|
+
JEKYLL_VERSION: ${{ matrix.jekyll_version }}
|
44
|
+
strategy:
|
45
|
+
fail-fast: false
|
46
|
+
matrix:
|
47
|
+
ruby_version:
|
48
|
+
- 2.5
|
49
|
+
jekyll_version:
|
50
|
+
- "~> 3.9"
|
51
|
+
steps:
|
52
|
+
- uses: actions/checkout@v2
|
53
|
+
with:
|
54
|
+
fetch-depth: 5
|
55
|
+
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
56
|
+
uses: ruby/setup-ruby@v1
|
57
|
+
with:
|
58
|
+
ruby-version: ${{ matrix.ruby_version }}
|
59
|
+
bundler-cache: true
|
60
|
+
- name: Execute tests
|
61
|
+
run: bundle exec rspec
|
62
|
+
|
63
|
+
style_check:
|
64
|
+
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
65
|
+
name: "Code Style Check (Ruby ${{ matrix.ruby_version }})"
|
66
|
+
runs-on: 'ubuntu-latest'
|
67
|
+
strategy:
|
68
|
+
fail-fast: false
|
69
|
+
matrix:
|
70
|
+
ruby_version:
|
71
|
+
- 2.5
|
72
|
+
steps:
|
73
|
+
- uses: actions/checkout@v2
|
74
|
+
with:
|
75
|
+
fetch-depth: 5
|
76
|
+
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
77
|
+
uses: ruby/setup-ruby@v1
|
78
|
+
with:
|
79
|
+
ruby-version: ${{ matrix.ruby_version }}
|
80
|
+
bundler-cache: true
|
81
|
+
- name: Check Style Offenses
|
82
|
+
run: bundle exec rubocop -S -D
|
83
|
+
|
84
|
+
gem_build:
|
85
|
+
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
86
|
+
name: "Test Gem build (Ruby ${{ matrix.ruby_version }})"
|
87
|
+
runs-on: 'ubuntu-latest'
|
88
|
+
strategy:
|
89
|
+
fail-fast: false
|
90
|
+
matrix:
|
91
|
+
ruby_version:
|
92
|
+
- 2.5
|
93
|
+
steps:
|
94
|
+
- uses: actions/checkout@v2
|
95
|
+
with:
|
96
|
+
fetch-depth: 5
|
97
|
+
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
98
|
+
uses: ruby/setup-ruby@v1
|
99
|
+
with:
|
100
|
+
ruby-version: ${{ matrix.ruby_version }}
|
101
|
+
bundler-cache: true
|
102
|
+
- name: Test Gem build
|
103
|
+
run: bundle exec gem build jekyll-seo-tag.gemspec
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Release Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
paths:
|
8
|
+
- "lib/**/version.rb"
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
release:
|
12
|
+
if: "github.repository_owner == 'jekyll'"
|
13
|
+
name: "Release Gem (Ruby ${{ matrix.ruby_version }})"
|
14
|
+
runs-on: "ubuntu-latest"
|
15
|
+
strategy:
|
16
|
+
fail-fast: true
|
17
|
+
matrix:
|
18
|
+
ruby_version:
|
19
|
+
- 2.7
|
20
|
+
steps:
|
21
|
+
- name: Checkout Repository
|
22
|
+
uses: actions/checkout@v2
|
23
|
+
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: ${{ matrix.ruby_version }}
|
27
|
+
bundler-cache: true
|
28
|
+
- name: Build and Publish Gem
|
29
|
+
uses: ashmaroli/release-gem@dist
|
30
|
+
with:
|
31
|
+
gemspec_name: jekyll-seo-tag
|
32
|
+
env:
|
33
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_GEM_PUSH_API_KEY }}
|
File without changes
|
@@ -9,8 +9,22 @@ on:
|
|
9
9
|
- master
|
10
10
|
jobs:
|
11
11
|
build_n_profile:
|
12
|
-
|
13
|
-
runs-on:
|
12
|
+
name: "Third-Party Repo Profile (Jekyll ${{ matrix.jekyll_version }}, Ruby ${{ matrix.ruby_version }})"
|
13
|
+
runs-on: "ubuntu-latest"
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
ruby_version:
|
18
|
+
- 2.7
|
19
|
+
jekyll_version:
|
20
|
+
- "~> 4.0"
|
21
|
+
- "~> 3.9"
|
22
|
+
env:
|
23
|
+
BUNDLE_GEMFILE: "sandbox/Gemfile"
|
24
|
+
BUNDLE_PATH: "vendor/bundle"
|
25
|
+
BUNDLE_JOBS: 4
|
26
|
+
BUNDLE_RETRY: 3
|
27
|
+
JEKYLL_VERSION: ${{ matrix.jekyll_version }}
|
14
28
|
steps:
|
15
29
|
- name: Checkout Jekyll SEO Tag
|
16
30
|
uses: actions/checkout@v2
|
@@ -21,32 +35,19 @@ jobs:
|
|
21
35
|
uses: actions/checkout@v2
|
22
36
|
with:
|
23
37
|
repository: ashmaroli/tomjoht.github.io
|
24
|
-
ref:
|
38
|
+
ref: "no-seo-tag"
|
25
39
|
path: alpha-sandbox
|
26
40
|
- name: Checkout Same Third-Party Repository (WITH SEO Tag)
|
27
41
|
uses: actions/checkout@v2
|
28
42
|
with:
|
29
43
|
repository: ashmaroli/tomjoht.github.io
|
30
|
-
ref:
|
44
|
+
ref: "seo-tag"
|
31
45
|
path: sandbox
|
32
|
-
- name: Set up Ruby
|
33
|
-
uses:
|
46
|
+
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
47
|
+
uses: ruby/setup-ruby@v1
|
34
48
|
with:
|
35
|
-
ruby-version:
|
36
|
-
|
37
|
-
uses: actions/cache@v1
|
38
|
-
with:
|
39
|
-
path: sandbox/vendor/bundle
|
40
|
-
key: ubuntu-latest-gems-
|
41
|
-
restore-keys: |
|
42
|
-
ubuntu-latest-gems-
|
43
|
-
- name: Set up Dependencies
|
44
|
-
run: |
|
45
|
-
gem update --system --no-document
|
46
|
-
gem update bundler --no-document
|
47
|
-
bundle config gemfile sandbox/Gemfile
|
48
|
-
bundle config path vendor/bundle
|
49
|
-
bundle install --jobs 4 --retry 3
|
49
|
+
ruby-version: ${{ matrix.ruby_version }}
|
50
|
+
bundler-cache: true
|
50
51
|
- name: Run Jekyll Build (WITHOUT SEO Tag) 3 times
|
51
52
|
run: |
|
52
53
|
bundle exec jekyll build -s alpha-sandbox -d alpha-sandbox/_site --trace
|
@@ -58,4 +59,4 @@ jobs:
|
|
58
59
|
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
|
59
60
|
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
|
60
61
|
- name: Memory Analysis of Jekyll Build (WITH SEO Tag)
|
61
|
-
run:
|
62
|
+
run: bash jekyll-seo-tag/.github/workflows/scripts/memprof
|
data/.rubocop.yml
CHANGED
@@ -5,15 +5,38 @@ inherit_gem:
|
|
5
5
|
rubocop-jekyll: .rubocop.yml
|
6
6
|
|
7
7
|
AllCops:
|
8
|
-
TargetRubyVersion: 2.
|
8
|
+
TargetRubyVersion: 2.5
|
9
|
+
SuggestExtensions: false
|
9
10
|
Exclude:
|
10
11
|
- vendor/**/*
|
11
12
|
|
13
|
+
Layout/LineEndStringConcatenationIndentation:
|
14
|
+
Enabled: true
|
12
15
|
Layout/LineLength:
|
13
16
|
Exclude:
|
14
17
|
- spec/**/*
|
15
18
|
- jekyll-seo-tag.gemspec
|
16
19
|
|
20
|
+
Lint/EmptyInPattern:
|
21
|
+
Enabled: false
|
22
|
+
|
17
23
|
Metrics/BlockLength:
|
18
24
|
Exclude:
|
19
25
|
- spec/**/*
|
26
|
+
|
27
|
+
Naming/InclusiveLanguage:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Performance/MapCompact:
|
31
|
+
Enabled: true
|
32
|
+
Performance/RedundantEqualityComparisonBlock:
|
33
|
+
Enabled: true
|
34
|
+
Performance/RedundantSplitRegexpArgument:
|
35
|
+
Enabled: true
|
36
|
+
|
37
|
+
Style/InPatternThen:
|
38
|
+
Enabled: false
|
39
|
+
Style/MultilineInPatternThen:
|
40
|
+
Enabled: false
|
41
|
+
Style/QuotedSymbols:
|
42
|
+
Enabled: true
|
data/.rubocop_todo.yml
CHANGED
@@ -1,13 +1,46 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config --auto-gen-only-exclude`
|
3
|
-
# on
|
3
|
+
# on 2021-09-17 06:40:32 UTC using RuboCop version 1.18.4.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: AllowComments.
|
11
|
+
Lint/EmptyClass:
|
12
|
+
Exclude:
|
13
|
+
- 'lib/jekyll-seo-tag/version.rb'
|
14
|
+
|
15
|
+
# Offense count: 3
|
16
|
+
Lint/NoReturnInBeginEndBlocks:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/jekyll-seo-tag/author_drop.rb'
|
19
|
+
- 'lib/jekyll-seo-tag/drop.rb'
|
20
|
+
|
9
21
|
# Offense count: 1
|
10
22
|
# Cop supports --auto-correct.
|
11
23
|
Lint/ToJSON:
|
12
24
|
Exclude:
|
13
25
|
- 'lib/jekyll-seo-tag/json_ld_drop.rb'
|
26
|
+
|
27
|
+
# Offense count: 1
|
28
|
+
# Configuration parameters: IgnoredMethods, Max.
|
29
|
+
Metrics/PerceivedComplexity:
|
30
|
+
Exclude:
|
31
|
+
- 'lib/jekyll-seo-tag/drop.rb'
|
32
|
+
|
33
|
+
# Offense count: 1
|
34
|
+
# Configuration parameters: MinSize.
|
35
|
+
Performance/CollectionLiteralInLoop:
|
36
|
+
Exclude:
|
37
|
+
- 'spec/jekyll_seo_tag/author_drop_spec.rb'
|
38
|
+
|
39
|
+
# Offense count: 9
|
40
|
+
# Cop supports --auto-correct.
|
41
|
+
Style/RedundantBegin:
|
42
|
+
Exclude:
|
43
|
+
- 'lib/jekyll-seo-tag.rb'
|
44
|
+
- 'lib/jekyll-seo-tag/author_drop.rb'
|
45
|
+
- 'lib/jekyll-seo-tag/drop.rb'
|
46
|
+
- 'lib/jekyll-seo-tag/image_drop.rb'
|
data/History.markdown
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
## 2.8.0 / 2022-02-04
|
2
|
+
|
3
|
+
### Minor Enhancements
|
4
|
+
|
5
|
+
* Allow to set type for author (#427)
|
6
|
+
* Allow setting `author.url` (#453)
|
7
|
+
* Implement Facebook domain verification (#455)
|
8
|
+
* Add `og:image:alt` and `twitter:image:alt` (#438)
|
9
|
+
* Sort JSON-LD data by key (#458)
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Set the default `og:type` to 'website' (#391)
|
14
|
+
* Template: Remove double new line (#454)
|
15
|
+
|
16
|
+
### Development Fixes
|
17
|
+
|
18
|
+
* Fix typo in source code comment (#449)
|
19
|
+
* Set up Continuous Integration via GH Actions (#450)
|
20
|
+
* Bump RuboCop to v1.18.x (#452)
|
21
|
+
* Add workflow to release gem via GH Actions
|
22
|
+
|
1
23
|
## 2.7.1 / 2020-10-18
|
2
24
|
|
3
25
|
### Development Fixes
|
data/docs/advanced-usage.md
CHANGED
@@ -68,6 +68,18 @@ There are several ways to convey this author-specific information. Author inform
|
|
68
68
|
author: benbalter
|
69
69
|
```
|
70
70
|
|
71
|
+
#### Setting author url
|
72
|
+
|
73
|
+
Starting from August 6, 2021 [Google recommends](https://developers.google.com/search/updates) to set the `author.url` property. This property helps Google to disambiguate the correct author of the article.
|
74
|
+
|
75
|
+
You can set it the same way as the other author properties. For example, you can put it in an `author` object, in the site's `_config.yml`, e.g.:
|
76
|
+
|
77
|
+
```yml
|
78
|
+
author:
|
79
|
+
name: My Name
|
80
|
+
url: https://example.com/
|
81
|
+
```
|
82
|
+
|
71
83
|
### Customizing JSON-LD output
|
72
84
|
|
73
85
|
The following options can be set for any particular page. While the default options are meant to serve most users in the most common circumstances, there may be situations where more precise control is necessary.
|
@@ -86,6 +98,7 @@ For most users, setting `image: [path-to-image]` on a per-page basis should be e
|
|
86
98
|
* `path` - The relative path to the image. Same as `image: [path-to-image]`
|
87
99
|
* `height` - The height of the Open Graph (`og:image`) image
|
88
100
|
* `width` - The width of the Open Graph (`og:image`) image
|
101
|
+
* `alt` - The alternative image text for Open Graph (`og:image:alt`) and Twitter (`twitter:image:alt`)
|
89
102
|
|
90
103
|
You can use any of the above, optional properties, like so:
|
91
104
|
|
@@ -94,6 +107,7 @@ image:
|
|
94
107
|
path: /img/twitter.png
|
95
108
|
height: 100
|
96
109
|
width: 100
|
110
|
+
alt: Twitter Logo
|
97
111
|
```
|
98
112
|
|
99
113
|
### Setting a default image
|
@@ -146,7 +160,7 @@ Which will generate following canonical_url:
|
|
146
160
|
You can override the default title modifier for paginated pages from `Page %{current} of %{total} for ` to a string of your
|
147
161
|
choice by setting a `seo_paginator_message` key in your `_config.yml`.
|
148
162
|
|
149
|
-
For example:
|
163
|
+
For example:
|
150
164
|
|
151
165
|
```yml
|
152
166
|
seo_paginator_message: "%<current>s / %<total>s | "
|
data/docs/usage.md
CHANGED
@@ -65,6 +65,7 @@ The following properties are available:
|
|
65
65
|
alexa: 1234
|
66
66
|
yandex: 1234
|
67
67
|
baidu: 1234
|
68
|
+
facebook: 1234
|
68
69
|
```
|
69
70
|
* `locale` - The locale these tags are marked up in. Of the format `language_TERRITORY`. Default is `en_US`. Takes priority
|
70
71
|
over existing config key `lang`.
|
data/jekyll-seo-tag.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
20
20
|
end
|
21
21
|
|
22
|
-
spec.required_ruby_version = ">= 2.
|
22
|
+
spec.required_ruby_version = ">= 2.5.0"
|
23
23
|
|
24
24
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|spec|features)/!) }
|
25
25
|
spec.bindir = "exe"
|
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency "bundler", ">= 1.15"
|
31
31
|
spec.add_development_dependency "html-proofer", "~> 3.7"
|
32
32
|
spec.add_development_dependency "rspec", "~> 3.5"
|
33
|
-
spec.add_development_dependency "rubocop-jekyll", "~> 0.
|
33
|
+
spec.add_development_dependency "rubocop-jekyll", "~> 0.12.0"
|
34
34
|
end
|
@@ -41,8 +41,7 @@ module Jekyll
|
|
41
41
|
|
42
42
|
private
|
43
43
|
|
44
|
-
attr_reader :page
|
45
|
-
attr_reader :site
|
44
|
+
attr_reader :site, :page
|
46
45
|
|
47
46
|
# Finds the page author in the page.author, page.authors, or site.author
|
48
47
|
#
|
@@ -75,9 +74,10 @@ module Jekyll
|
|
75
74
|
# or an empty hash, if the author cannot be resolved
|
76
75
|
def author_hash
|
77
76
|
@author_hash ||= begin
|
78
|
-
|
77
|
+
case resolved_author
|
78
|
+
when Hash
|
79
79
|
resolved_author
|
80
|
-
|
80
|
+
when String
|
81
81
|
{ "name" => resolved_author }.merge!(site_data_hash)
|
82
82
|
else
|
83
83
|
{}
|
@@ -34,17 +34,17 @@ module Jekyll
|
|
34
34
|
|
35
35
|
private
|
36
36
|
|
37
|
-
attr_accessor :page
|
38
|
-
attr_accessor :context
|
37
|
+
attr_accessor :page, :context
|
39
38
|
|
40
39
|
# The normalized image hash with a `path` key (which may be nil)
|
41
40
|
def image_hash
|
42
41
|
@image_hash ||= begin
|
43
42
|
image_meta = page["image"]
|
44
43
|
|
45
|
-
|
44
|
+
case image_meta
|
45
|
+
when Hash
|
46
46
|
{ "path" => nil }.merge!(image_meta)
|
47
|
-
|
47
|
+
when String
|
48
48
|
{ "path" => image_meta }
|
49
49
|
else
|
50
50
|
{ "path" => nil }
|
@@ -16,12 +16,12 @@ module Jekyll
|
|
16
16
|
def_delegator :page_drop, :type, :type
|
17
17
|
|
18
18
|
# Expose #type and #logo as private methods and #@type as a public method
|
19
|
-
alias_method
|
20
|
-
private :type
|
21
|
-
private :logo
|
19
|
+
alias_method :@type, :type
|
20
|
+
private :type, :logo
|
22
21
|
|
23
22
|
VALID_ENTITY_TYPES = %w(BlogPosting CreativeWork).freeze
|
24
|
-
|
23
|
+
VALID_AUTHOR_TYPES = %w(Organization Person).freeze
|
24
|
+
private_constant :VALID_ENTITY_TYPES, :VALID_AUTHOR_TYPES
|
25
25
|
|
26
26
|
# page_drop should be an instance of Jekyll::SeoTag::Drop
|
27
27
|
def initialize(page_drop)
|
@@ -38,10 +38,18 @@ module Jekyll
|
|
38
38
|
def author
|
39
39
|
return unless page_drop.author["name"]
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
author_type = page_drop.author["type"]
|
42
|
+
return if author_type && !VALID_AUTHOR_TYPES.include?(author_type)
|
43
|
+
|
44
|
+
hash = {
|
45
|
+
"@type" => author_type || "Person",
|
43
46
|
"name" => page_drop.author["name"],
|
44
47
|
}
|
48
|
+
|
49
|
+
author_url = page_drop.author["url"]
|
50
|
+
hash["url"] = author_url if author_url
|
51
|
+
|
52
|
+
hash
|
45
53
|
end
|
46
54
|
|
47
55
|
def image
|
@@ -79,8 +87,13 @@ module Jekyll
|
|
79
87
|
alias_method :mainEntityOfPage, :main_entity
|
80
88
|
private :main_entity
|
81
89
|
|
82
|
-
|
83
|
-
|
90
|
+
# Returns a JSON-encoded object containing the JSON-LD data.
|
91
|
+
# Keys are sorted.
|
92
|
+
def to_json(state = nil)
|
93
|
+
keys.sort.each_with_object({}) do |(key, _), result|
|
94
|
+
v = self[key]
|
95
|
+
result[key] = v unless v.nil?
|
96
|
+
end.to_json(state)
|
84
97
|
end
|
85
98
|
|
86
99
|
private
|
@@ -8,8 +8,8 @@ module Jekyll
|
|
8
8
|
|
9
9
|
# Determines if the given string is an absolute URL
|
10
10
|
#
|
11
|
-
# Returns true if an absolute URL
|
12
|
-
#
|
11
|
+
# Returns true if an absolute URL
|
12
|
+
# Returns false if it's a relative URL
|
13
13
|
# Returns nil if it is not a string or can't be parsed as a URL
|
14
14
|
def absolute_url?(string)
|
15
15
|
return unless string
|
data/lib/template.html
CHANGED
@@ -37,11 +37,16 @@
|
|
37
37
|
{% if seo_tag.image.width %}
|
38
38
|
<meta property="og:image:width" content="{{ seo_tag.image.width }}" />
|
39
39
|
{% endif %}
|
40
|
+
{% if seo_tag.image.alt %}
|
41
|
+
<meta property="og:image:alt" content="{{ seo_tag.image.alt }}" />
|
42
|
+
{% endif %}
|
40
43
|
{% endif %}
|
41
44
|
|
42
45
|
{% if page.date %}
|
43
46
|
<meta property="og:type" content="article" />
|
44
47
|
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}" />
|
48
|
+
{% else %}
|
49
|
+
<meta property="og:type" content="website" />
|
45
50
|
{% endif %}
|
46
51
|
|
47
52
|
{% if paginator.previous_page %}
|
@@ -51,7 +56,6 @@
|
|
51
56
|
<link rel="next" href="{{ paginator.next_page_path | absolute_url }}" />
|
52
57
|
{% endif %}
|
53
58
|
|
54
|
-
|
55
59
|
{% if seo_tag.image %}
|
56
60
|
<meta name="twitter:card" content="{{ page.twitter.card | default: site.twitter.card | default: "summary_large_image" }}" />
|
57
61
|
<meta property="twitter:image" content="{{ seo_tag.image.path }}" />
|
@@ -59,6 +63,10 @@
|
|
59
63
|
<meta name="twitter:card" content="summary" />
|
60
64
|
{% endif %}
|
61
65
|
|
66
|
+
{% if seo_tag.image.alt %}
|
67
|
+
<meta name="twitter:image:alt" content="{{ seo_tag.image.alt }}" />
|
68
|
+
{% endif %}
|
69
|
+
|
62
70
|
{% if seo_tag.page_title %}
|
63
71
|
<meta property="twitter:title" content="{{ seo_tag.page_title }}" />
|
64
72
|
{% endif %}
|
@@ -105,6 +113,10 @@
|
|
105
113
|
{% if site.webmaster_verifications.baidu %}
|
106
114
|
<meta name="baidu-site-verification" content="{{ site.webmaster_verifications.baidu }}" />
|
107
115
|
{% endif %}
|
116
|
+
|
117
|
+
{% if site.webmaster_verifications.facebook %}
|
118
|
+
<meta name="facebook-domain-verification" content="{{ site.webmaster_verifications.facebook }}" />
|
119
|
+
{% endif %}
|
108
120
|
{% elsif site.google_site_verification %}
|
109
121
|
<meta name="google-site-verification" content="{{ site.google_site_verification }}" />
|
110
122
|
{% endif %}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-seo-tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -78,14 +78,14 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 0.12.0
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 0.12.0
|
89
89
|
description:
|
90
90
|
email:
|
91
91
|
- ben.balter@github.com
|
@@ -93,13 +93,15 @@ executables: []
|
|
93
93
|
extensions: []
|
94
94
|
extra_rdoc_files: []
|
95
95
|
files:
|
96
|
-
- ".github/workflows/
|
96
|
+
- ".github/workflows/ci.yml"
|
97
|
+
- ".github/workflows/release.yml"
|
98
|
+
- ".github/workflows/scripts/memprof"
|
99
|
+
- ".github/workflows/scripts/memprof.rb"
|
97
100
|
- ".github/workflows/third-party.yml"
|
98
101
|
- ".gitignore"
|
99
102
|
- ".rspec"
|
100
103
|
- ".rubocop.yml"
|
101
104
|
- ".rubocop_todo.yml"
|
102
|
-
- ".travis.yml"
|
103
105
|
- Gemfile
|
104
106
|
- History.markdown
|
105
107
|
- LICENSE.txt
|
@@ -137,14 +139,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
139
|
requirements:
|
138
140
|
- - ">="
|
139
141
|
- !ruby/object:Gem::Version
|
140
|
-
version: 2.
|
142
|
+
version: 2.5.0
|
141
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
144
|
requirements:
|
143
145
|
- - ">="
|
144
146
|
- !ruby/object:Gem::Version
|
145
147
|
version: '0'
|
146
148
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.1.6
|
148
150
|
signing_key:
|
149
151
|
specification_version: 4
|
150
152
|
summary: A Jekyll plugin to add metadata tags for search engines and social networks
|
data/.travis.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
rvm:
|
4
|
-
- 2.5
|
5
|
-
- 2.7
|
6
|
-
|
7
|
-
before_install:
|
8
|
-
- gem update --system
|
9
|
-
- gem install bundler
|
10
|
-
|
11
|
-
script: script/cibuild
|
12
|
-
|
13
|
-
env:
|
14
|
-
global:
|
15
|
-
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
16
|
-
matrix:
|
17
|
-
- JEKYLL_VERSION="~> 3.9"
|
18
|
-
- JEKYLL_VERSION="~> 4.0"
|