From bdedd23bf20d4963c4f7c97934f3531fdb64cda3 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Sat, 20 Feb 2016 14:26:06 -0500 Subject: [PATCH] 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