diff --git a/.rubocop.yml b/.rubocop.yml index adad792..e5c8df6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +inherit_from: .rubocop_todo.yml + require: rubocop-jekyll inherit_gem: rubocop-jekyll: .rubocop.yml diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..8d8b2c8 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,13 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2019-03-25 11:42:06 +0100 using RuboCop version 0.66.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# Cop supports --auto-correct. +Lint/ToJSON: + Exclude: + - 'lib/jekyll-seo-tag/json_ld_drop.rb' diff --git a/.travis.yml b/.travis.yml index 4c96096..69a0c96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,18 @@ -rvm: - - 2.3 - - 2.4 - - 2.5 -before_install: gem install bundler language: ruby -script: script/cibuild -sudo: false cache: bundler +rvm: + - 2.4 + - 2.6 + +before_install: + - gem update --system + - gem install bundler + +script: script/cibuild env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true + matrix: + - JEKYLL_VERSION="~> 3.3" + - JEKYLL_VERSION=">= 4.0.0.pre.alpha1" diff --git a/Gemfile b/Gemfile index 83c46ca..a1ebfdb 100644 --- a/Gemfile +++ b/Gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gemspec -gem "github-pages", :group => :jekyll_plugins +gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"] diff --git a/History.markdown b/History.markdown index ae17192..4252067 100644 --- a/History.markdown +++ b/History.markdown @@ -1,16 +1,42 @@ ## HEAD +### Documentation + + * HTTPS links to schema.org (#350) + * use example.com for example URL (#351) + * remove Google+ from example snippet (#358) + * HTTPS link to https://ogp.me/ (#359) + +## 2.6.1 / 2019-05-17 + +### Development Fixes + + * Test against Jekyll 4.x (#336) + +## 2.6.0 / 2019-03-16 + +### Minor Enhancements + + * Twitter Image and Title (#330) + ### Bug Fixes + * Do not cache the drop payload for SeoTag (#306) * Update url of schema website (#296) ### Development Fixes - * Lint Ruby code with rubocop-jekyll gem (#302) - * deps: bump rubocop-jekyll to 0.3.0 (#316) - * Correct RuboCop offenses in spec files (#319) - * chore(deps): :up: rubocop-jekyll 0.4 (#320) * Relax version constraint on Bundler (#325) + * chore(ci): Add Ruby 2.6, drop Ruby 2.3 (#326) + * chore (ci): remove deprecated `sudo: false` in .travis.yml (#333) + * Lint Ruby code with rubocop-jekyll gem (#302) + * chore(deps): bump rubocop-jekyll to v0.4 (#320) + * chore(deps): bump rubocop-jekyll to v0.3 (#316) + * Correct RuboCop offenses in spec files (#319) + +### Documentation + + * Rectify error in Usage documentation (#328) ## 2.5.0 / 2018-05-18 diff --git a/docs/README.md b/docs/README.md index a168de8..9a9557d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -12,8 +12,8 @@ Jekyll SEO Tag adds the following meta tags to your site: * Page description * Canonical URL * Next and previous URLs on paginated pages -* [JSON-LD Site and post metadata](https://developers.google.com/structured-data/) for richer indexing -* [Open Graph](http://ogp.me/) title, description, site title, and URL (for Facebook, LinkedIn, etc.) +* [JSON-LD Site and post metadata](https://developers.google.com/search/docs/guides/intro-structured-data) for richer indexing +* [Open Graph](https://ogp.me/) title, description, site title, and URL (for Facebook, LinkedIn, etc.) * [Twitter Summary Card](https://dev.twitter.com/cards/overview) metadata While you could theoretically add the necessary metadata tags yourself, Jekyll SEO Tag provides a battle-tested template of crowdsourced best-practices. diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index e93554f..985c494 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -74,8 +74,10 @@ The following options can be set for any particular page. While the default opti * `seo` * `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é") - * `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. + * `type` - The type of things that the page represents. This must be a [Schema.org type](https://schema.org/docs/schemas.html), and will probably usually be something like [`BlogPosting`](https://schema.org/BlogPosting), [`NewsArticle`](https://schema.org/NewsArticle), [`Person`](https://schema.org/Person), [`Organization`](https://schema.org/Organization), etc. * `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. + * `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. ### Customizing image output @@ -136,7 +138,7 @@ title: Title of Your Post Which will generate following canonical_url: ```html - + ``` ### Customizing title modifier for paginated pages diff --git a/docs/usage.md b/docs/usage.md index c966ae8..38ae530 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -35,7 +35,6 @@ The SEO tag will respect any of the following if included in your site's `_confi * `social` - For [specifying social profiles](https://developers.google.com/structured-data/customize/social-profiles). The following properties are available: * `name` - If the user or organization name differs from the site's name * `links` - An array of links to social media profiles. - * `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. ```yml social: @@ -44,7 +43,6 @@ The SEO tag will respect any of the following if included in your site's `_confi - https://twitter.com/BenBalter - https://www.facebook.com/ben.balter - https://www.linkedin.com/in/BenBalter - - https://plus.google.com/+BenBalter - https://github.com/benbalter - https://keybase.io/benbalter ``` diff --git a/jekyll-seo-tag.gemspec b/jekyll-seo-tag.gemspec index 31d92aa..23ccce1 100644 --- a/jekyll-seo-tag.gemspec +++ b/jekyll-seo-tag.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r!^exe/!) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "jekyll", "~> 3.3" + spec.add_dependency "jekyll", ">= 3.3", "< 5.0" spec.add_development_dependency "bundler", ">= 1.15" spec.add_development_dependency "html-proofer", "~> 3.7" spec.add_development_dependency "rspec", "~> 3.5" diff --git a/lib/jekyll-seo-tag.rb b/lib/jekyll-seo-tag.rb index 933fc53..589fd13 100644 --- a/lib/jekyll-seo-tag.rb +++ b/lib/jekyll-seo-tag.rb @@ -56,7 +56,11 @@ module Jekyll end def drop - @drop ||= Jekyll::SeoTag::Drop.new(@text, @context) + if context.registers[:site].liquid_renderer.respond_to?(:cache) + Jekyll::SeoTag::Drop.new(@text, @context) + else + @drop ||= Jekyll::SeoTag::Drop.new(@text, @context) + end end def info diff --git a/lib/jekyll-seo-tag/version.rb b/lib/jekyll-seo-tag/version.rb index 3fe158c..3a3808f 100644 --- a/lib/jekyll-seo-tag/version.rb +++ b/lib/jekyll-seo-tag/version.rb @@ -5,6 +5,6 @@ module Liquid; class Tag; end; end module Jekyll class SeoTag < Liquid::Tag - VERSION = "2.5.0" + VERSION = "2.6.1" end end diff --git a/lib/template.html b/lib/template.html index c2dffef..6422141 100755 --- a/lib/template.html +++ b/lib/template.html @@ -54,10 +54,12 @@ {% if site.twitter %} {% if seo_tag.image %} + {% else %} {% endif %} + {% if seo_tag.author.twitter %}