From fd06faf86c79cdf9a0807db36bc2ac7f49d85941 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Wed, 6 Jan 2016 10:00:20 -0800 Subject: [PATCH] Use baseurl to build seo_url --- lib/template.html | 2 +- spec/jekyll_seo_tag_spec.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/template.html b/lib/template.html index 89a7004..85c745f 100644 --- a/lib/template.html +++ b/lib/template.html @@ -1,7 +1,7 @@ {% if site.url %} - {% assign seo_url = site.url %} + {% assign seo_url = site.url | append: site.baseurl %} {% elsif site.github.url %} {% assign seo_url = site.github.url %} {% endif %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index ad871c7..1bc8a04 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -86,6 +86,15 @@ describe Jekyll::SeoTag do expect(subject.render(context)).to match(expected) end + it "uses baseurl to build the seo url" do + site = site({ "url" => "http://example.invalid", "baseurl" => "/foo" }) + context = context({ :site => site }) + expected = %r!! + expect(subject.render(context)).to match(expected) + expected = %r!! + expect(subject.render(context)).to match(expected) + end + it "outputs the site title meta" do site = site({"title" => "Foo", "url" => "http://example.invalid"}) context = context({ :site => site })