diff --git a/History.markdown b/History.markdown index 54bda88..2672e26 100644 --- a/History.markdown +++ b/History.markdown @@ -4,6 +4,8 @@ * Allow to set type for author (#427) * Allow setting `author.url` (#453) + * Implement Facebook domain verification (#455) + * Add `og:image:alt` and `twitter:image:alt` (#438) ### Development Fixes diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index e534abd..f334496 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -98,6 +98,7 @@ For most users, setting `image: [path-to-image]` on a per-page basis should be e * `path` - The relative path to the image. Same as `image: [path-to-image]` * `height` - The height of the Open Graph (`og:image`) image * `width` - The width of the Open Graph (`og:image`) image +* `alt` - The alternative image text for Open Graph (`og:image:alt`) and Twitter (`twitter:image:alt`) You can use any of the above, optional properties, like so: @@ -106,6 +107,7 @@ image: path: /img/twitter.png height: 100 width: 100 + alt: Twitter Logo ``` ### Setting a default image @@ -158,7 +160,7 @@ Which will generate following canonical_url: You can override the default title modifier for paginated pages from `Page %{current} of %{total} for ` to a string of your choice by setting a `seo_paginator_message` key in your `_config.yml`. -For example: +For example: ```yml seo_paginator_message: "%s / %s | " diff --git a/docs/usage.md b/docs/usage.md index 489c233..20dbd41 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -65,6 +65,7 @@ The following properties are available: alexa: 1234 yandex: 1234 baidu: 1234 + facebook: 1234 ``` * `locale` - The locale these tags are marked up in. Of the format `language_TERRITORY`. Default is `en_US`. Takes priority over existing config key `lang`. diff --git a/lib/template.html b/lib/template.html index c073c0c..1a3c979 100755 --- a/lib/template.html +++ b/lib/template.html @@ -37,6 +37,9 @@ {% if seo_tag.image.width %} {% endif %} + {% if seo_tag.image.alt %} + + {% endif %} {% endif %} {% if page.date %} @@ -60,6 +63,10 @@ {% endif %} +{% if seo_tag.image.alt %} + +{% endif %} + {% if seo_tag.page_title %} {% endif %} @@ -106,6 +113,10 @@ {% if site.webmaster_verifications.baidu %} {% endif %} + + {% if site.webmaster_verifications.facebook %} + + {% endif %} {% elsif site.google_site_verification %} {% endif %} diff --git a/spec/jekyll_seo_tag_integration_spec.rb b/spec/jekyll_seo_tag_integration_spec.rb index b0b9d26..cde2e77 100755 --- a/spec/jekyll_seo_tag_integration_spec.rb +++ b/spec/jekyll_seo_tag_integration_spec.rb @@ -614,10 +614,11 @@ RSpec.describe Jekyll::SeoTag do context "with site.webmaster_verifications" do let(:site_verifications) do { - "google" => "foo", - "bing" => "bar", - "alexa" => "baz", - "yandex" => "bat", + "google" => "foo", + "bing" => "bar", + "alexa" => "baz", + "yandex" => "bat", + "facebook" => "bas", } end @@ -642,6 +643,11 @@ RSpec.describe Jekyll::SeoTag do expected = %r!! expect(output).to match(expected) end + + it "outputs facebook verification meta" do + expected = %r!! + expect(output).to match(expected) + end end context "with site.google_site_verification" do