From bdedd23bf20d4963c4f7c97934f3531fdb64cda3 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Sat, 20 Feb 2016 14:26:06 -0500 Subject: [PATCH 1/2] expose version in HTML comment --- lib/jekyll-seo-tag.rb | 1 + lib/template.html | 2 +- spec/jekyll_seo_tag_spec.rb | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/jekyll-seo-tag.rb b/lib/jekyll-seo-tag.rb index 376772f..dd71ea7 100644 --- a/lib/jekyll-seo-tag.rb +++ b/lib/jekyll-seo-tag.rb @@ -17,6 +17,7 @@ module Jekyll def payload { + 'seo_tag' => { 'version' => VERSION }, 'page' => context.registers[:page], 'site' => context.registers[:site].site_payload['site'] } diff --git a/lib/template.html b/lib/template.html index 9a77b4c..4c45ad0 100644 --- a/lib/template.html +++ b/lib/template.html @@ -1,4 +1,4 @@ - + {% if site.url %} {% assign seo_url = site.url | append: site.baseurl %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 4408cba..86c8124 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -193,4 +193,9 @@ describe Jekyll::SeoTag do status = HTML::Proofer.new(dest_dir, options).run expect(status).to eql(true) end + + it 'outputs the plugin version' do + version = Jekyll::SeoTag::VERSION + expect(subject.render(context)).to match(/Jekyll SEO tag v#{version}/i) + end end From 86775d50f7028ce2d85cf0af5ca9702fe07f8dca Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Sat, 20 Feb 2016 14:27:04 -0500 Subject: [PATCH 2/2] whitespace --- lib/jekyll-seo-tag.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll-seo-tag.rb b/lib/jekyll-seo-tag.rb index dd71ea7..c2e443f 100644 --- a/lib/jekyll-seo-tag.rb +++ b/lib/jekyll-seo-tag.rb @@ -18,8 +18,8 @@ module Jekyll def payload { 'seo_tag' => { 'version' => VERSION }, - 'page' => context.registers[:page], - 'site' => context.registers[:site].site_payload['site'] + 'page' => context.registers[:page], + 'site' => context.registers[:site].site_payload['site'] } end