Add facebook admins meta tag to template and facebook spec

This commit is contained in:
Miguel Flores Ruiz de Eguino 2016-05-11 12:52:28 -05:00
parent ddb96a01ca
commit f772747728
3 changed files with 34 additions and 1 deletions

View File

@ -60,12 +60,14 @@ The SEO tag will respect any of the following if included in your site's `_confi
username: benbalter
```
* `facebook:app_id` (a Facebook app ID for Facebook insights), and/or `facebook:publisher` (a Facebook page URL or ID of the publishing entity). You'll want to describe one or both like so:
* `facebook:app_id` (a Facebook app ID for Facebook insights), `facebook:publisher` (a Facebook page URL or ID of the publishing entity) and/or `facebook:admins`
(a Facebook user ID for domain insights linked to a personal account). You'll want to describe one or both like so:
```yml
facebook:
app_id: 1234
publisher: 1234
admins: 1234
```
* `logo` - URL to a site-wide logo (e.g., `/assets/your-company-logo.png`)

View File

@ -164,6 +164,10 @@
{% endif %}
{% if site.facebook %}
{% if site.facebook.admins %}
<meta property="fb:admins" content="{{ site.facebook.admins }}" />
{% endif %}
{% if site.facebook.publisher %}
<meta property="article:publisher" content="{{ site.facebook.publisher }}" />
{% endif %}

View File

@ -252,6 +252,33 @@ EOS
end
end
context 'facebook' do
let(:site_facebook) do
{
'admins' => 'jekyllrb-fb-admins',
'app_id' => 'jekyllrb-fb-app_id',
'publisher' => 'jekyllrb-fb-publisher'
}
end
let(:site) { make_site('facebook' => site_facebook) }
it 'outputs facebook admins meta' do
expected = %r{<meta property="fb:admins" content="jekyllrb-fb-admins" />}
expect(output).to match(expected)
end
it 'outputs facebook app ID meta' do
expected = %r{<meta property="fb:app_id" content="jekyllrb-fb-app_id" />}
expect(output).to match(expected)
end
it 'outputs facebook article publisher meta' do
expected = %r{<meta property="article:publisher" content="jekyllrb-fb-publisher" />}
expect(output).to match(expected)
end
end
context 'twitter' do
context 'with site.twitter.username' do
let(:site_twitter) { { 'username' => 'jekyllrb' } }