jekyll-seo-tag 2.5.0 → 2.6.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
  SHA256:
3
- metadata.gz: 7dfc0385fb69c3aa6632916ea056d33c415170fb0d38fa16acf9310d68d24c01
4
- data.tar.gz: 1b0e657d2a3f8da3a9f7f55eba87fec578b59c3979d0930896adc12783fed157
3
+ metadata.gz: 8297d8859bf6e52c0a77bfbda660ff832f1cdb6eb0a5112c98b2e3fd9fdf4647
4
+ data.tar.gz: 867eb20b76f4437622cd881f0a21a39f4ffabf51268c81a1e228c7e0461e753c
5
5
  SHA512:
6
- metadata.gz: c106de99699b188a26903bfea3f9916394f8d0c448c487115b3bcaaf46216bfff9bbeffae3b36fd970be4cec3d03feb40989a39fa6a90647fb9a1ee5ef5baf8a
7
- data.tar.gz: cb86303b5bf7a62cfb39716fb9957e2bdbc5d118958baea7bf164b8479678629db175961e2f698d436686b9a80662756b6a632c99e39f468d1f70d3ce2e5361b
6
+ metadata.gz: ce913e55583ea6354413717fa3945a20f6a8c4fa7dd763918b141ca1e32a2eec011b78e40613dc7297126a4623efbd5cc450f69da841acd4e1d4aece62360acb
7
+ data.tar.gz: 7773d8759ff186edd5b6ba906edfc7ea992dd39f814582aeef2d94ed3606dae034e49318c16d53896ce1a663f56462b7ad51248d959ee12d1370e53047249185
@@ -1,5 +1,6 @@
1
+ require: rubocop-jekyll
1
2
  inherit_gem:
2
- jekyll: .rubocop.yml
3
+ rubocop-jekyll: .rubocop.yml
3
4
 
4
5
  AllCops:
5
6
  TargetRubyVersion: 2.3
@@ -14,7 +15,3 @@ Metrics/LineLength:
14
15
  Metrics/BlockLength:
15
16
  Exclude:
16
17
  - spec/**/*
17
-
18
- Layout/IndentHeredoc:
19
- Exclude:
20
- - spec/**/*
@@ -1,12 +1,11 @@
1
+ language: ruby
2
+ cache: bundler
1
3
  rvm:
2
- - 2.3
3
4
  - 2.4
4
- - 2.5
5
+ - 2.6
6
+
5
7
  before_install: gem install bundler
6
- language: ruby
7
8
  script: script/cibuild
8
- sudo: false
9
- cache: bundler
10
9
 
11
10
  env:
12
11
  global:
@@ -1,3 +1,34 @@
1
+ ## HEAD
2
+
3
+ ### Minor Enhancements
4
+
5
+ * Release: v2.6.0 (#334)
6
+
7
+ ## 2.6.0 / 2019-03-16
8
+
9
+ ### Minor Enhancements
10
+
11
+ * Twitter Image and Title (#330)
12
+
13
+ ### Bug Fixes
14
+
15
+ * Do not cache the drop payload for SeoTag (#306)
16
+ * Update url of schema website (#296)
17
+
18
+ ### Development Fixes
19
+
20
+ * Relax version constraint on Bundler (#325)
21
+ * chore(ci): Add Ruby 2.6, drop Ruby 2.3 (#326)
22
+ * chore (ci): remove deprecated `sudo: false` in .travis.yml (#333)
23
+ * Lint Ruby code with rubocop-jekyll gem (#302)
24
+ * chore(deps): bump rubocop-jekyll to v0.4 (#320)
25
+ * chore(deps): bump rubocop-jekyll to v0.3 (#316)
26
+ * Correct RuboCop offenses in spec files (#319)
27
+
28
+ ### Documentation
29
+
30
+ * Rectify error in Usage documentation (#328)
31
+
1
32
  ## 2.5.0 / 2018-05-18
2
33
 
3
34
  * Docs: Prevent GitHub Pages from processing Liquid raw tag (#276)
@@ -76,6 +76,8 @@ The following options can be set for any particular page. While the default opti
76
76
  * `name` - If the name of the thing that the page represents is different from the page title. (i.e.: "Frank's Café" vs "Welcome to Frank's Café")
77
77
  * `type` - The type of things that the page represents. This must be a [Schema.org type](http://schema.org/docs/schemas.html), and will probably usually be something like [`BlogPosting`](http://schema.org/BlogPosting), [`NewsArticle`](http://schema.org/NewsArticle), [`Person`](http://schema.org/Person), [`Organization`](http://schema.org/Organization), etc.
78
78
  * `links` - An array of other URLs that represent the same thing that this page represents. For instance, Jane's bio page might include links to Jane's GitHub and Twitter profiles.
79
+ * `date_modified` - Manually specify the `dateModified` field in the JSON-LD output to override Jekyll's own `dateModified`.
80
+ This field will take **first priority** for the `dateModified` JSON-LD output. This is useful when the file timestamp does not match the true time that the content was modified. A user may also install [Last Modified At](https://github.com/gjtorikian/jekyll-last-modified-at) which will offer an alternative way of providing for the `dateModified` field.
79
81
 
80
82
  ### Customizing image output
81
83
 
@@ -35,7 +35,6 @@ The SEO tag will respect any of the following if included in your site's `_confi
35
35
  * `social` - For [specifying social profiles](https://developers.google.com/structured-data/customize/social-profiles). The following properties are available:
36
36
  * `name` - If the user or organization name differs from the site's name
37
37
  * `links` - An array of links to social media profiles.
38
- * `date_modified` - Manually specify the `dateModified` field in the JSON-LD output to override Jekyll's own `dateModified`. This field will take **first priority** for the `dateModified` JSON-LD output. This is useful when the file timestamp does not match the true time that the content was modified. A user may also install [Last Modified At](https://github.com/gjtorikian/jekyll-last-modified-at) which will offer an alternative way of providing for the `dateModified` field.
39
38
 
40
39
  ```yml
41
40
  social:
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  spec.add_dependency "jekyll", "~> 3.3"
32
- spec.add_development_dependency "bundler", "~> 1.15"
32
+ spec.add_development_dependency "bundler", ">= 1.15"
33
33
  spec.add_development_dependency "html-proofer", "~> 3.7"
34
34
  spec.add_development_dependency "rspec", "~> 3.5"
35
- spec.add_development_dependency "rubocop", "~> 0.56.0"
35
+ spec.add_development_dependency "rubocop-jekyll", "~> 0.4"
36
36
  end
@@ -24,7 +24,7 @@ module Jekyll
24
24
  # We will not strip any whitespace if the next character is a '-'
25
25
  # so that we do not interfere with the HTML comment at the
26
26
  # very begining
27
- MINIFY_REGEX = %r!(?<=[{}]|[>,]\n)\s+(?\!-)!
27
+ MINIFY_REGEX = %r!(?<=[{}]|[>,]\n)\s+(?\!-)!.freeze
28
28
 
29
29
  def initialize(_tag_name, text, _tokens)
30
30
  super
@@ -47,15 +47,20 @@ module Jekyll
47
47
 
48
48
  def payload
49
49
  # site_payload is an instance of UnifiedPayloadDrop. See https://git.io/v5ajm
50
- Jekyll::Utils.deep_merge_hashes(context.registers[:site].site_payload, {
50
+ Jekyll::Utils.deep_merge_hashes(
51
+ context.registers[:site].site_payload,
51
52
  "page" => context.registers[:page],
52
53
  "paginator" => context["paginator"],
53
- "seo_tag" => drop,
54
- })
54
+ "seo_tag" => drop
55
+ )
55
56
  end
56
57
 
57
58
  def drop
58
- @drop ||= Jekyll::SeoTag::Drop.new(@text, @context)
59
+ if context.registers[:site].liquid_renderer.respond_to?(:cache)
60
+ Jekyll::SeoTag::Drop.new(@text, @context)
61
+ else
62
+ @drop ||= Jekyll::SeoTag::Drop.new(@text, @context)
63
+ end
59
64
  end
60
65
 
61
66
  def info
@@ -19,6 +19,7 @@ module Jekyll
19
19
  # site - The Jekyll::Drops::SiteDrop
20
20
  def initialize(page: nil, site: nil)
21
21
  raise ArgumentError unless page && site
22
+
22
23
  @mutations = {}
23
24
  @page = page
24
25
  @site = site
@@ -33,6 +34,7 @@ module Jekyll
33
34
 
34
35
  def twitter
35
36
  return @twitter if defined? @twitter
37
+
36
38
  twitter = author_hash["twitter"] || author_hash["name"]
37
39
  @twitter = twitter.is_a?(String) ? twitter.sub(%r!^@!, "") : nil
38
40
  end
@@ -47,6 +49,7 @@ module Jekyll
47
49
  # Returns a string or hash representing the author
48
50
  def resolved_author
49
51
  return @resolved_author if defined? @resolved_author
52
+
50
53
  sources = [page["author"]]
51
54
  sources << page["authors"].first if page["authors"].is_a?(Array)
52
55
  sources << site["author"]
@@ -61,6 +64,7 @@ module Jekyll
61
64
  @site_data_hash ||= begin
62
65
  return {} unless resolved_author.is_a?(String)
63
66
  return {} unless site.data["authors"].is_a?(Hash)
67
+
64
68
  author_hash = site.data["authors"][resolved_author]
65
69
  author_hash.is_a?(Hash) ? author_hash : {}
66
70
  end
@@ -6,10 +6,10 @@ module Jekyll
6
6
  include Jekyll::SeoTag::UrlHelper
7
7
 
8
8
  TITLE_SEPARATOR = " | "
9
- FORMAT_STRING_METHODS = %i[
10
- markdownify strip_html normalize_whitespace escape_once
9
+ FORMAT_STRING_METHODS = [
10
+ :markdownify, :strip_html, :normalize_whitespace, :escape_once,
11
11
  ].freeze
12
- HOMEPAGE_OR_ABOUT_REGEX = %r!^/(about/)?(index.html?)?$!
12
+ HOMEPAGE_OR_ABOUT_REGEX = %r!^/(about/)?(index.html?)?$!.freeze
13
13
 
14
14
  def initialize(text, context)
15
15
  @obj = {}
@@ -26,6 +26,7 @@ module Jekyll
26
26
  def title?
27
27
  return false unless title
28
28
  return @display_title if defined?(@display_title)
29
+
29
30
  @display_title = (@text !~ %r!title=false!i)
30
31
  end
31
32
 
@@ -43,6 +44,7 @@ module Jekyll
43
44
  end
44
45
 
45
46
  # Page title with site title or description appended
47
+ # rubocop:disable Metrics/CyclomaticComplexity
46
48
  def title
47
49
  @title ||= begin
48
50
  if site_title && page_title != site_title
@@ -54,15 +56,15 @@ module Jekyll
54
56
  end
55
57
  end
56
58
 
57
- if page_number
58
- return page_number + @title
59
- end
59
+ return page_number + @title if page_number
60
60
 
61
61
  @title
62
62
  end
63
+ # rubocop:enable Metrics/CyclomaticComplexity
63
64
 
64
65
  def name
65
66
  return @name if defined?(@name)
67
+
66
68
  @name = if seo_name
67
69
  seo_name
68
70
  elsif !homepage_or_about?
@@ -141,6 +143,7 @@ module Jekyll
141
143
  def logo
142
144
  @logo ||= begin
143
145
  return unless site["logo"]
146
+
144
147
  if absolute_url? site["logo"]
145
148
  filters.uri_escape site["logo"]
146
149
  else
@@ -187,9 +190,7 @@ module Jekyll
187
190
  current = @context["paginator"]["page"]
188
191
  total = @context["paginator"]["total_pages"]
189
192
 
190
- if current > 1
191
- return "Page #{current} of #{total} for "
192
- end
193
+ return "Page #{current} of #{total} for " if current > 1
193
194
  end
194
195
 
195
196
  attr_reader :context
@@ -18,6 +18,7 @@ module Jekyll
18
18
  # context - the Liquid::Context
19
19
  def initialize(page: nil, context: nil)
20
20
  raise ArgumentError unless page && context
21
+
21
22
  @mutations = {}
22
23
  @page = page
23
24
  @context = context
@@ -57,6 +58,7 @@ module Jekyll
57
58
  def absolute_url
58
59
  return unless raw_path
59
60
  return @absolute_url if defined? @absolute_url
61
+
60
62
  @absolute_url = if raw_path.is_a?(String) && absolute_url?(raw_path) == false
61
63
  filters.absolute_url raw_path
62
64
  else
@@ -28,12 +28,13 @@ module Jekyll
28
28
 
29
29
  def fallback_data
30
30
  {
31
- "@context" => "http://schema.org",
31
+ "@context" => "https://schema.org",
32
32
  }
33
33
  end
34
34
 
35
35
  def author
36
36
  return unless page_drop.author["name"]
37
+
37
38
  {
38
39
  "@type" => "Person",
39
40
  "name" => page_drop.author["name"],
@@ -52,6 +53,7 @@ module Jekyll
52
53
 
53
54
  def publisher
54
55
  return unless logo
56
+
55
57
  output = {
56
58
  "@type" => "Organization",
57
59
  "logo" => {
@@ -65,6 +67,7 @@ module Jekyll
65
67
 
66
68
  def main_entity
67
69
  return unless %w(BlogPosting CreativeWork).include?(type)
70
+
68
71
  {
69
72
  "@type" => "WebPage",
70
73
  "@id" => page_drop.canonical_url,
@@ -13,6 +13,7 @@ module Jekyll
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
16
+
16
17
  Addressable::URI.parse(string).absolute?
17
18
  rescue Addressable::URI::InvalidURIError
18
19
  nil
@@ -5,6 +5,6 @@ module Liquid; class Tag; end; end
5
5
 
6
6
  module Jekyll
7
7
  class SeoTag < Liquid::Tag
8
- VERSION = "2.5.0"
8
+ VERSION = "2.6.0"
9
9
  end
10
10
  end
@@ -54,10 +54,12 @@
54
54
  {% if site.twitter %}
55
55
  {% if seo_tag.image %}
56
56
  <meta name="twitter:card" content="{{ page.twitter.card | default: site.twitter.card | default: "summary_large_image" }}" />
57
+ <meta property="twitter:image" content="{{ seo_tag.image.path }}" />
57
58
  {% else %}
58
59
  <meta name="twitter:card" content="summary" />
59
60
  {% endif %}
60
61
 
62
+ <meta property="twitter:title" content="{{ seo_tag.page_title }}" />
61
63
  <meta name="twitter:site" content="@{{ site.twitter.username | replace:"@","" }}" />
62
64
 
63
65
  {% if seo_tag.author.twitter %}
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.5.0
4
+ version: 2.6.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: 2018-05-21 00:00:00.000000000 Z
11
+ date: 2019-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.15'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.15'
41
41
  - !ruby/object:Gem::Dependency
@@ -67,19 +67,19 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.5'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rubocop
70
+ name: rubocop-jekyll
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.56.0
75
+ version: '0.4'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.56.0
82
+ version: '0.4'
83
83
  description:
84
84
  email:
85
85
  - ben.balter@github.com
@@ -135,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.7.6
138
+ rubygems_version: 3.0.3
140
139
  signing_key:
141
140
  specification_version: 4
142
141
  summary: A Jekyll plugin to add metadata tags for search engines and social networks