add facebook opengraph tags

This commit is contained in:
Dean Attali 2015-03-31 00:30:08 -07:00
parent 66df8a95ca
commit ed14a7cdc4

View File

@ -6,7 +6,7 @@
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="author" content="{{ site.author.name }}" />
<meta name="description" content="{{ site.description }}">
<meta name="description" content="{% if page.subtitle %}{{ page.subtitle }}{% else %}{{ site.description }}{% endif %}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }} - {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />
@ -45,4 +45,23 @@
<link rel="stylesheet" href="//fonts.googleapis.com/css?family={{ font }}" />
{% endfor %}
{% endif %}
<!-- Facebook OpenGraph tags -->
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" />
<meta property="og:type" content="website" />
{% if page.id %}
<meta property="og:url" content="{{ site.url }}{{ page.url }}/" />
{% else %}
<meta property="og:url" content="{{ site.url }}{{ page.url | remove: '/index.html' | remove: '.html' }}" />
{% endif %}
{% if page.fb-img %}
<meta property="og:image" content="{{ page.fb-img }}" />
{% elif site.avatar %}
<meta property="og:image" content="{{ site.url }}{{ site.avatar }}" />
{% else %}
<meta property="og:image" content="" />
{% endif %}
</head>