diff --git a/README.md b/README.md index c4ee3b3..75f5f65 100644 --- a/README.md +++ b/README.md @@ -69,5 +69,5 @@ The SEO tag will respect the following YAML front matter if included in a post, * `title` - The title of the post, page, or document * `description` - A short description of the page's content -* `image` - The absolute URL to an image that should be associated with the post, page, or document +* `image` - Relative URL to an image associated with the post, page, or document (e.g., `assets/page-pic.jpg`) * `author` - The username of the post, page, or document author diff --git a/lib/template.html b/lib/template.html index 838fdda..4a5db80 100644 --- a/lib/template.html +++ b/lib/template.html @@ -94,7 +94,7 @@ {% endif %} {% if page.image %} - + {% endif %} {% if page.date %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 5110973..3118013 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -153,9 +153,10 @@ describe Jekyll::SeoTag do end it "outputs the image" do - page = page({"image" => "http://foo.invalid/foo.png"}) - context = context({ :page => page }) - expected = // + page = page({ "image" => "foo.png" }) + site = site({ "url" => "http://example.invalid" }) + context = context({ :page => page, :site => site }) + expected = %r!! expect(subject.render(context)).to match(expected) end