jekyll-seo-tag 2.2.0 → 2.2.1
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 +4 -4
- data/.rspec +1 -1
- data/History.markdown +5 -0
- data/lib/jekyll-seo-tag.rb +8 -3
- data/lib/jekyll-seo-tag/drop.rb +244 -0
- data/lib/jekyll-seo-tag/filters.rb +12 -0
- data/lib/jekyll-seo-tag/json_ld.rb +79 -0
- data/lib/jekyll-seo-tag/version.rb +1 -1
- data/lib/template.html +28 -193
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d007bd49496c661cf441f17dc25d6756ae9daf31
|
4
|
+
data.tar.gz: c1a2dc3f79edacd4d68fedc1c8f518249a5a59a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eec356674ff4054de62b1d022cbf206496fc4eb17dc2933137764851310b5350d1b0b6bd8403ff80a2faf9e8184f8a85d4eeeecf572752d2ea8d5cfe0c68e36
|
7
|
+
data.tar.gz: 12088f4299da9829ab61d2c04ce1994cbcd3999f32cd3489aab59053bcf1b3584342e9c4e6bddf1cd082e95032094d2179c0713977f4eea5e4ab338e8e52e3f5
|
data/.rspec
CHANGED
data/History.markdown
CHANGED
data/lib/jekyll-seo-tag.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
require "jekyll"
|
1
2
|
require "jekyll-seo-tag/version"
|
2
3
|
|
3
4
|
module Jekyll
|
4
5
|
class SeoTag < Liquid::Tag
|
6
|
+
autoload :JSONLD, "jekyll-seo-tag/json_ld"
|
7
|
+
autoload :Drop, "jekyll-seo-tag/drop"
|
8
|
+
autoload :Filters, "jekyll-seo-tag/filters"
|
9
|
+
|
5
10
|
attr_accessor :context
|
6
11
|
|
7
12
|
# Matches all whitespace that follows either
|
@@ -39,12 +44,12 @@ module Jekyll
|
|
39
44
|
"page" => context.registers[:page],
|
40
45
|
"site" => context.registers[:site].site_payload["site"],
|
41
46
|
"paginator" => context["paginator"],
|
42
|
-
"seo_tag" =>
|
47
|
+
"seo_tag" => drop,
|
43
48
|
}
|
44
49
|
end
|
45
50
|
|
46
|
-
def
|
47
|
-
@text
|
51
|
+
def drop
|
52
|
+
@drop ||= Jekyll::SeoTag::Drop.new(@text, @context)
|
48
53
|
end
|
49
54
|
|
50
55
|
def info
|
@@ -0,0 +1,244 @@
|
|
1
|
+
module Jekyll
|
2
|
+
class SeoTag
|
3
|
+
class Drop < Jekyll::Drops::Drop
|
4
|
+
include Jekyll::SeoTag::JSONLD
|
5
|
+
|
6
|
+
TITLE_SEPARATOR = " | ".freeze
|
7
|
+
FORMAT_STRING_METHODS = %i[
|
8
|
+
markdownify strip_html normalize_whitespace escape_once
|
9
|
+
].freeze
|
10
|
+
HOMEPAGE_OR_ABOUT_REGEX = %r!^/(about/)?(index.html?)?$!
|
11
|
+
|
12
|
+
def initialize(text, context)
|
13
|
+
@obj = {}
|
14
|
+
@mutations = {}
|
15
|
+
@text = text
|
16
|
+
@context = context
|
17
|
+
end
|
18
|
+
|
19
|
+
def version
|
20
|
+
Jekyll::SeoTag::VERSION
|
21
|
+
end
|
22
|
+
|
23
|
+
# Should the `<title>` tag be generated for this page?
|
24
|
+
def title?
|
25
|
+
return false unless title
|
26
|
+
return @display_title if defined?(@display_title)
|
27
|
+
@display_title = (@text !~ %r!title=false!i)
|
28
|
+
end
|
29
|
+
|
30
|
+
def site_title
|
31
|
+
@site_title ||= format_string(site["title"] || site["name"])
|
32
|
+
end
|
33
|
+
|
34
|
+
# Page title without site title or description appended
|
35
|
+
def page_title
|
36
|
+
@page_title ||= format_string(page["title"] || site_title)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Page title with site title or description appended
|
40
|
+
def title
|
41
|
+
@title ||= begin
|
42
|
+
if page["title"] && site_title
|
43
|
+
page_title + TITLE_SEPARATOR + site_title
|
44
|
+
elsif site["description"] && site_title
|
45
|
+
site_title + TITLE_SEPARATOR + format_string(site["description"])
|
46
|
+
else
|
47
|
+
page_title || site_title
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def name
|
53
|
+
return @name if defined?(@name)
|
54
|
+
@name = if seo_name
|
55
|
+
seo_name
|
56
|
+
elsif !homepage_or_about?
|
57
|
+
nil
|
58
|
+
elsif site["social"] && site["social"]["name"]
|
59
|
+
format_string site["social"]["name"]
|
60
|
+
elsif site_title
|
61
|
+
format_string site_title
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def description
|
66
|
+
@description ||= format_string(
|
67
|
+
page["description"] || page["excerpt"] || site["description"]
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Returns a nil or a hash representing the author
|
72
|
+
# Author name will be pulled from:
|
73
|
+
#
|
74
|
+
# 1. The `author` key, if the key is a string
|
75
|
+
# 2. The first author in the `authors` key
|
76
|
+
# 3. The `author` key in the site config
|
77
|
+
#
|
78
|
+
# If the result from the name search is a string, we'll also check
|
79
|
+
# to see if the author exists in `site.data.authors`
|
80
|
+
def author
|
81
|
+
@author ||= begin
|
82
|
+
return if author_string_or_hash.to_s.empty?
|
83
|
+
|
84
|
+
author = if author_string_or_hash.is_a?(String)
|
85
|
+
author_hash(author_string_or_hash)
|
86
|
+
else
|
87
|
+
author_string_or_hash
|
88
|
+
end
|
89
|
+
|
90
|
+
author["twitter"] ||= author["name"]
|
91
|
+
author["twitter"].delete! "@"
|
92
|
+
author.to_liquid
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def date_modified
|
97
|
+
@date_modified ||= begin
|
98
|
+
date = if page["seo"] && page["seo"]["date_modified"]
|
99
|
+
page["seo"]["date_modified"]
|
100
|
+
elsif page["last_modified_at"]
|
101
|
+
page["last_modified_at"].to_liquid
|
102
|
+
else
|
103
|
+
page["date"]
|
104
|
+
end
|
105
|
+
filters.date_to_xmlschema(date) if date
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def date_published
|
110
|
+
@date_published ||= filters.date_to_xmlschema(page["date"]) if page["date"]
|
111
|
+
end
|
112
|
+
|
113
|
+
def type
|
114
|
+
@type ||= begin
|
115
|
+
if page["seo"] && page["seo"]["type"]
|
116
|
+
page["seo"]["type"]
|
117
|
+
elsif homepage_or_about?
|
118
|
+
"WebSite"
|
119
|
+
elsif page["date"]
|
120
|
+
"BlogPosting"
|
121
|
+
else
|
122
|
+
"WebPage"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def links
|
128
|
+
@links ||= begin
|
129
|
+
if page["seo"] && page["seo"]["links"]
|
130
|
+
page["seo"]["links"]
|
131
|
+
elsif homepage_or_about? && site["social"] && site["social"]["links"]
|
132
|
+
site["social"]["links"]
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def logo
|
138
|
+
@logo ||= begin
|
139
|
+
return unless site["logo"]
|
140
|
+
if absolute_url? site["logo"]
|
141
|
+
filters.uri_escape site["logo"]
|
142
|
+
else
|
143
|
+
filters.uri_escape filters.absolute_url site["logo"]
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Returns nil or a hash representing the page image
|
149
|
+
# The image hash will always contain a path, pulled from:
|
150
|
+
#
|
151
|
+
# 1. The `image` key if it's a string
|
152
|
+
# 2. The `image.path` key if it's a hash
|
153
|
+
# 3. The `image.facebook` key
|
154
|
+
# 4. The `image.twitter` key
|
155
|
+
#
|
156
|
+
# The resulting path is always an absolute URL
|
157
|
+
def image
|
158
|
+
return @image if defined?(@image)
|
159
|
+
|
160
|
+
image = page["image"]
|
161
|
+
return @image = nil unless image
|
162
|
+
|
163
|
+
image = { "path" => image } if image.is_a?(String)
|
164
|
+
image["path"] ||= image["facebook"] || image["twitter"]
|
165
|
+
|
166
|
+
unless absolute_url? image["path"]
|
167
|
+
image["path"] = filters.absolute_url image["path"]
|
168
|
+
end
|
169
|
+
|
170
|
+
image["path"] = filters.uri_escape image["path"]
|
171
|
+
|
172
|
+
@image = image.to_liquid
|
173
|
+
end
|
174
|
+
|
175
|
+
def page_lang
|
176
|
+
@page_lang ||= page["lang"] || site["lang"] || "en_US"
|
177
|
+
end
|
178
|
+
|
179
|
+
def canonical_url
|
180
|
+
@canonical_url ||= filters.absolute_url(page["url"]).gsub(%r!/index\.html$!, "/")
|
181
|
+
end
|
182
|
+
|
183
|
+
private
|
184
|
+
|
185
|
+
def filters
|
186
|
+
@filters ||= Jekyll::SeoTag::Filters.new(@context)
|
187
|
+
end
|
188
|
+
|
189
|
+
def page
|
190
|
+
@page ||= @context.registers[:page].to_liquid
|
191
|
+
end
|
192
|
+
|
193
|
+
def site
|
194
|
+
@site ||= @context.registers[:site].site_payload["site"].to_liquid
|
195
|
+
end
|
196
|
+
|
197
|
+
def homepage_or_about?
|
198
|
+
page["url"] =~ HOMEPAGE_OR_ABOUT_REGEX
|
199
|
+
end
|
200
|
+
|
201
|
+
attr_reader :context
|
202
|
+
|
203
|
+
def fallback_data
|
204
|
+
@fallback_data ||= {}
|
205
|
+
end
|
206
|
+
|
207
|
+
def absolute_url?(string)
|
208
|
+
Addressable::URI.parse(string).absolute?
|
209
|
+
end
|
210
|
+
|
211
|
+
def format_string(string)
|
212
|
+
string = FORMAT_STRING_METHODS.reduce(string) do |memo, method|
|
213
|
+
filters.public_send(method, memo)
|
214
|
+
end
|
215
|
+
|
216
|
+
string unless string.empty?
|
217
|
+
end
|
218
|
+
|
219
|
+
def author_string_or_hash
|
220
|
+
@author_string_or_hash ||= begin
|
221
|
+
author = page["author"]
|
222
|
+
author = page["authors"][0] if author.to_s.empty? && page["authors"]
|
223
|
+
author = site["author"] if author.to_s.empty?
|
224
|
+
author
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
def author_hash(author_string)
|
229
|
+
if site.data["authors"] && site.data["authors"][author_string]
|
230
|
+
hash = site.data["authors"][author_string]
|
231
|
+
hash["name"] ||= author_string
|
232
|
+
hash["twitter"] ||= author_string
|
233
|
+
hash
|
234
|
+
else
|
235
|
+
{ "name" => author_string }
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
def seo_name
|
240
|
+
@seo_name ||= format_string(page["seo"]["name"]) if page["seo"]
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module Jekyll
|
2
|
+
class SeoTag
|
3
|
+
module JSONLD
|
4
|
+
|
5
|
+
# A hash of instance methods => key in resulting JSON-LD hash
|
6
|
+
METHODS_KEYS = {
|
7
|
+
:json_context => "@context",
|
8
|
+
:type => "@type",
|
9
|
+
:name => "name",
|
10
|
+
:page_title => "headline",
|
11
|
+
:json_author => "author",
|
12
|
+
:json_image => "image",
|
13
|
+
:date_published => "datePublished",
|
14
|
+
:date_modified => "dateModified",
|
15
|
+
:description => "description",
|
16
|
+
:publisher => "publisher",
|
17
|
+
:main_entity => "mainEntityOfPage",
|
18
|
+
:links => "sameAs",
|
19
|
+
:canonical_url => "url",
|
20
|
+
}.freeze
|
21
|
+
|
22
|
+
def json_ld
|
23
|
+
@json_ld ||= begin
|
24
|
+
output = {}
|
25
|
+
METHODS_KEYS.each do |method, key|
|
26
|
+
value = send(method)
|
27
|
+
output[key] = value unless value.nil?
|
28
|
+
end
|
29
|
+
output
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def json_context
|
36
|
+
"http://schema.org"
|
37
|
+
end
|
38
|
+
|
39
|
+
def json_author
|
40
|
+
return unless author
|
41
|
+
{
|
42
|
+
"@type" => "Person",
|
43
|
+
"name" => author["name"],
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
def json_image
|
48
|
+
return unless image
|
49
|
+
return image["path"] if image.length == 1
|
50
|
+
|
51
|
+
hash = image.dup
|
52
|
+
hash["url"] = hash.delete("path")
|
53
|
+
hash["@type"] = "imageObject"
|
54
|
+
hash
|
55
|
+
end
|
56
|
+
|
57
|
+
def publisher
|
58
|
+
return unless logo
|
59
|
+
output = {
|
60
|
+
"@type" => "Organization",
|
61
|
+
"logo" => {
|
62
|
+
"@type" => "ImageObject",
|
63
|
+
"url" => logo,
|
64
|
+
},
|
65
|
+
}
|
66
|
+
output["name"] = author["name"] if author
|
67
|
+
output
|
68
|
+
end
|
69
|
+
|
70
|
+
def main_entity
|
71
|
+
return unless %w(BlogPosting CreativeWork).include?(type)
|
72
|
+
{
|
73
|
+
"@type" => "WebPage",
|
74
|
+
"@id" => canonical_url,
|
75
|
+
}
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/lib/template.html
CHANGED
@@ -1,143 +1,39 @@
|
|
1
1
|
<!-- Begin Jekyll SEO tag v{{ seo_tag.version }} -->
|
2
|
-
|
3
|
-
{
|
4
|
-
{% assign seo_homepage_or_about = true %}
|
5
|
-
{% endif %}
|
6
|
-
|
7
|
-
{% assign seo_site_title = site.title | default: site.name %}
|
8
|
-
{% assign seo_page_title = page.title | default: seo_site_title %}
|
9
|
-
{% assign seo_title = page.title | default: seo_site_title %}
|
10
|
-
|
11
|
-
{% if page.title and seo_site_title %}
|
12
|
-
{% assign seo_title = page.title | append:" | " | append: seo_site_title %}
|
13
|
-
{% elsif site.description and seo_site_title %}
|
14
|
-
{% assign seo_title = seo_site_title | append:" | " | append: site.description %}
|
15
|
-
{% endif %}
|
16
|
-
|
17
|
-
{% if page.seo and page.seo.name %}
|
18
|
-
{% assign seo_name = page.seo.name %}
|
19
|
-
{% elsif seo_homepage_or_about and site.social and site.social.name %}
|
20
|
-
{% assign seo_name = site.social.name %}
|
21
|
-
{% elsif seo_homepage_or_about and seo_site_title %}
|
22
|
-
{% assign seo_name = seo_site_title %}
|
23
|
-
{% endif %}
|
24
|
-
{% if seo_name %}
|
25
|
-
{% assign seo_name = seo_name | smartify | strip_html | normalize_whitespace | escape_once %}
|
26
|
-
{% endif %}
|
27
|
-
|
28
|
-
{% if seo_title %}
|
29
|
-
{% assign seo_title = seo_title | smartify | strip_html | normalize_whitespace | escape_once %}
|
30
|
-
{% endif %}
|
31
|
-
|
32
|
-
{% if seo_site_title %}
|
33
|
-
{% assign seo_site_title = seo_site_title | smartify | strip_html | normalize_whitespace | escape_once %}
|
34
|
-
{% endif %}
|
35
|
-
|
36
|
-
{% if seo_page_title %}
|
37
|
-
{% assign seo_page_title = seo_page_title | smartify | strip_html | normalize_whitespace | escape_once %}
|
38
|
-
{% endif %}
|
39
|
-
|
40
|
-
{% assign seo_description = page.description | default: page.excerpt | default: site.description %}
|
41
|
-
{% if seo_description %}
|
42
|
-
{% assign seo_description = seo_description | markdownify | strip_html | normalize_whitespace | escape_once %}
|
43
|
-
{% endif %}
|
44
|
-
|
45
|
-
{% assign seo_author = page.author | default: page.authors[0] | default: site.author %}
|
46
|
-
{% if seo_author %}
|
47
|
-
{% if seo_author.name %}
|
48
|
-
{% assign seo_author_name = seo_author.name %}
|
49
|
-
{% else %}
|
50
|
-
{% if site.data.authors and site.data.authors[seo_author] %}
|
51
|
-
{% assign seo_author_name = site.data.authors[seo_author].name %}
|
52
|
-
{% else %}
|
53
|
-
{% assign seo_author_name = seo_author %}
|
54
|
-
{% endif %}
|
55
|
-
{% endif %}
|
56
|
-
{% if seo_author.twitter %}
|
57
|
-
{% assign seo_author_twitter = seo_author.twitter %}
|
58
|
-
{% else %}
|
59
|
-
{% if site.data.authors and site.data.authors[seo_author] %}
|
60
|
-
{% assign seo_author_twitter = site.data.authors[seo_author].twitter %}
|
61
|
-
{% else %}
|
62
|
-
{% assign seo_author_twitter = seo_author %}
|
63
|
-
{% endif %}
|
64
|
-
{% endif %}
|
65
|
-
{% assign seo_author_twitter = seo_author_twitter | replace:"@","" %}
|
66
|
-
{% endif %}
|
67
|
-
|
68
|
-
{% if page.date_modified or page.last_modified_at or page.date %}
|
69
|
-
{% assign seo_date_modified = page.seo.date_modified | default: page.last_modified_at %}
|
70
|
-
{% endif %}
|
71
|
-
|
72
|
-
{% if page.seo and page.seo.type %}
|
73
|
-
{% assign seo_type = page.seo.type %}
|
74
|
-
{% elsif seo_homepage_or_about %}
|
75
|
-
{% assign seo_type = "WebSite" %}
|
76
|
-
{% elsif page.date %}
|
77
|
-
{% assign seo_type = "BlogPosting" %}
|
78
|
-
{% else %}
|
79
|
-
{% assign seo_type = "WebPage" %}
|
80
|
-
{% endif %}
|
81
|
-
|
82
|
-
{% if page.seo and page.seo.links %}
|
83
|
-
{% assign seo_links = page.seo.links %}
|
84
|
-
{% elsif seo_homepage_or_about and site.social and site.social.links %}
|
85
|
-
{% assign seo_links = site.social.links %}
|
86
|
-
{% endif %}
|
87
|
-
|
88
|
-
{% if site.logo %}
|
89
|
-
{% assign seo_site_logo = site.logo %}
|
90
|
-
{% unless seo_site_logo contains "://" %}
|
91
|
-
{% assign seo_site_logo = seo_site_logo | absolute_url %}
|
92
|
-
{% endunless %}
|
93
|
-
{% assign seo_site_logo = seo_site_logo | escape %}
|
94
|
-
{% endif %}
|
95
|
-
|
96
|
-
{% if page.image %}
|
97
|
-
{% assign seo_page_image = page.image.path | default: page.image.facebook | default: page.image.twitter | default: page.image %}
|
98
|
-
{% unless seo_page_image contains "://" %}
|
99
|
-
{% assign seo_page_image = seo_page_image | absolute_url %}
|
100
|
-
{% endunless %}
|
101
|
-
{% assign seo_page_image = seo_page_image | escape %}
|
2
|
+
{% if seo_tag.title? %}
|
3
|
+
<title>{{ seo_tag.title }}</title>
|
102
4
|
{% endif %}
|
103
5
|
|
104
|
-
{%
|
105
|
-
|
106
|
-
{% if seo_tag.title and seo_title %}
|
107
|
-
<title>{{ seo_title }}</title>
|
108
|
-
{% endif %}
|
109
|
-
|
110
|
-
{% if seo_page_title %}
|
111
|
-
<meta property="og:title" content="{{ seo_page_title }}" />
|
6
|
+
{% if seo_tag.page_title %}
|
7
|
+
<meta property="og:title" content="{{ seo_tag.page_title }}" />
|
112
8
|
{% endif %}
|
113
9
|
|
114
|
-
{% if
|
115
|
-
<meta name="author" content="{{
|
10
|
+
{% if seo_tag.author.name %}
|
11
|
+
<meta name="author" content="{{ seo_tag.author.name }}" />
|
116
12
|
{% endif %}
|
117
13
|
|
118
|
-
<meta property="og:locale" content="{{
|
14
|
+
<meta property="og:locale" content="{{ seo_tag.page_lang | replace:'-','_' }}" />
|
119
15
|
|
120
|
-
{% if
|
121
|
-
<meta name="description" content="{{
|
122
|
-
<meta property="og:description" content="{{
|
16
|
+
{% if seo_tag.description %}
|
17
|
+
<meta name="description" content="{{ seo_tag.description }}" />
|
18
|
+
<meta property="og:description" content="{{ seo_tag.description }}" />
|
123
19
|
{% endif %}
|
124
20
|
|
125
|
-
{% if
|
126
|
-
<link rel="canonical" href="{{
|
127
|
-
<meta property="og:url" content="{{
|
21
|
+
{% if site.url %}
|
22
|
+
<link rel="canonical" href="{{ seo_tag.canonical_url }}" />
|
23
|
+
<meta property="og:url" content="{{ seo_tag.canonical_url }}" />
|
128
24
|
{% endif %}
|
129
25
|
|
130
|
-
{% if
|
131
|
-
<meta property="og:site_name" content="{{
|
26
|
+
{% if seo_tag.site_title %}
|
27
|
+
<meta property="og:site_name" content="{{ seo_tag.site_title }}" />
|
132
28
|
{% endif %}
|
133
29
|
|
134
|
-
{% if
|
135
|
-
<meta property="og:image" content="{{
|
136
|
-
{% if
|
137
|
-
<meta property="og:image:height" content="{{
|
30
|
+
{% if seo_tag.image %}
|
31
|
+
<meta property="og:image" content="{{ seo_tag.image.path }}" />
|
32
|
+
{% if seo_tag.image.height %}
|
33
|
+
<meta property="og:image:height" content="{{ seo_tag.image.height }}" />
|
138
34
|
{% endif %}
|
139
|
-
{% if
|
140
|
-
<meta property="og:image:width" content="{{
|
35
|
+
{% if seo_tag.image.width %}
|
36
|
+
<meta property="og:image:width" content="{{ seo_tag.image.width }}" />
|
141
37
|
{% endif %}
|
142
38
|
{% endif %}
|
143
39
|
|
@@ -154,7 +50,7 @@
|
|
154
50
|
{% endif %}
|
155
51
|
|
156
52
|
{% if site.twitter %}
|
157
|
-
{% if
|
53
|
+
{% if seo_tag.image %}
|
158
54
|
<meta name="twitter:card" content="summary_large_image" />
|
159
55
|
{% else %}
|
160
56
|
<meta name="twitter:card" content="summary" />
|
@@ -162,8 +58,8 @@
|
|
162
58
|
|
163
59
|
<meta name="twitter:site" content="@{{ site.twitter.username | replace:"@","" }}" />
|
164
60
|
|
165
|
-
{% if
|
166
|
-
<meta name="twitter:creator" content="@{{
|
61
|
+
{% if seo_tag.author.twitter %}
|
62
|
+
<meta name="twitter:creator" content="@{{ seo_tag.author.twitter }}" />
|
167
63
|
{% endif %}
|
168
64
|
{% endif %}
|
169
65
|
|
@@ -185,12 +81,15 @@
|
|
185
81
|
{% if site.webmaster_verifications.google %}
|
186
82
|
<meta name="google-site-verification" content="{{ site.webmaster_verifications.google }}">
|
187
83
|
{% endif %}
|
84
|
+
|
188
85
|
{% if site.webmaster_verifications.bing %}
|
189
86
|
<meta name="msvalidate.01" content="{{ site.webmaster_verifications.bing }}">
|
190
87
|
{% endif %}
|
88
|
+
|
191
89
|
{% if site.webmaster_verifications.alexa %}
|
192
90
|
<meta name="alexaVerifyID" content="{{ site.webmaster_verifications.alexa }}">
|
193
91
|
{% endif %}
|
92
|
+
|
194
93
|
{% if site.webmaster_verifications.yandex %}
|
195
94
|
<meta name="yandex-verification" content="{{ site.webmaster_verifications.yandex }}">
|
196
95
|
{% endif %}
|
@@ -198,72 +97,8 @@
|
|
198
97
|
<meta name="google-site-verification" content="{{ site.google_site_verification }}" />
|
199
98
|
{% endif %}
|
200
99
|
|
201
|
-
|
202
100
|
<script type="application/ld+json">
|
203
|
-
{
|
204
|
-
"@context": "http://schema.org",
|
205
|
-
|
206
|
-
{% if seo_type %}
|
207
|
-
"@type": {{ seo_type | jsonify }},
|
208
|
-
{% endif %}
|
209
|
-
|
210
|
-
{% if seo_name %}
|
211
|
-
"name": {{ seo_name | jsonify }},
|
212
|
-
{% endif %}
|
213
|
-
|
214
|
-
{% if seo_page_title %}
|
215
|
-
"headline": {{ seo_page_title | jsonify }},
|
216
|
-
{% endif %}
|
217
|
-
|
218
|
-
{% if seo_author %}
|
219
|
-
"author": {
|
220
|
-
"@type": "Person",
|
221
|
-
"name": {{ seo_author | jsonify }}
|
222
|
-
},
|
223
|
-
{% endif %}
|
224
|
-
|
225
|
-
{% if seo_page_image %}
|
226
|
-
"image": {{ seo_page_image | jsonify }},
|
227
|
-
{% endif %}
|
228
|
-
|
229
|
-
{% if page.date %}
|
230
|
-
"datePublished": {{ page.date | date_to_xmlschema | jsonify }},
|
231
|
-
{% endif %}
|
232
|
-
|
233
|
-
{% if seo_date_modified %}
|
234
|
-
"dateModified": {{ seo_date_modified | date_to_xmlschema | jsonify }},
|
235
|
-
{% endif %}
|
236
|
-
|
237
|
-
{% if seo_description %}
|
238
|
-
"description": {{ seo_description | jsonify }},
|
239
|
-
{% endif %}
|
240
|
-
|
241
|
-
{% if seo_site_logo %}
|
242
|
-
"publisher": {
|
243
|
-
"@type": "Organization",
|
244
|
-
{% if seo_author %}
|
245
|
-
"name": {{ seo_author | jsonify }},
|
246
|
-
{% endif %}
|
247
|
-
"logo": {
|
248
|
-
"@type": "ImageObject",
|
249
|
-
"url": {{ seo_site_logo | jsonify }}
|
250
|
-
}
|
251
|
-
},
|
252
|
-
{% endif %}
|
253
|
-
|
254
|
-
{% if seo_type == "BlogPosting" or seo_type == "CreativeWork"%}
|
255
|
-
"mainEntityOfPage": {
|
256
|
-
"@type": "WebPage",
|
257
|
-
"@id": {{ page.url | replace:'/index.html','/' | absolute_url | jsonify }}
|
258
|
-
},
|
259
|
-
{% endif %}
|
260
|
-
|
261
|
-
{% if seo_links %}
|
262
|
-
"sameAs": {{ seo_links | jsonify }},
|
263
|
-
{% endif %}
|
264
|
-
|
265
|
-
"url": {{ page.url | replace:'/index.html','/' | absolute_url | jsonify }}
|
266
|
-
}
|
101
|
+
{{ seo_tag.json_ld | jsonify }}
|
267
102
|
</script>
|
268
103
|
|
269
104
|
<!-- End Jekyll SEO tag -->
|
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.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -97,6 +97,9 @@ files:
|
|
97
97
|
- README.md
|
98
98
|
- jekyll-seo-tag.gemspec
|
99
99
|
- lib/jekyll-seo-tag.rb
|
100
|
+
- lib/jekyll-seo-tag/drop.rb
|
101
|
+
- lib/jekyll-seo-tag/filters.rb
|
102
|
+
- lib/jekyll-seo-tag/json_ld.rb
|
100
103
|
- lib/jekyll-seo-tag/version.rb
|
101
104
|
- lib/template.html
|
102
105
|
- script/bootstrap
|
@@ -123,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
126
|
version: '0'
|
124
127
|
requirements: []
|
125
128
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
129
|
+
rubygems_version: 2.6.11
|
127
130
|
signing_key:
|
128
131
|
specification_version: 4
|
129
132
|
summary: A Jekyll plugin to add metadata tags for search engines and social networks
|