Merge pull request #86 from miguelfrde/facebook-admins-meta

Facebook admins meta tag and Facebook options spec
This commit is contained in:
Ben Balter 2016-05-11 18:58:44 -04:00
commit 87e755c1ac
3 changed files with 38 additions and 1 deletions

View File

@ -60,12 +60,18 @@ 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` - The following properties are available:
* `facebook:app_id` - a Facebook app ID for Facebook insights
* `facebook:publisher` - a Facebook page URL or ID of the publishing entity
* `facebook:admins` - a Facebook user ID for domain insights linked to a personal account
You'll want to describe one or more 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' } }