add support for twitter cards (sharing on Twitter will be better); fixes #70
This commit is contained in:
parent
eb21409f4f
commit
abf1334585
2 changed files with 16 additions and 5 deletions
|
@ -52,19 +52,30 @@
|
|||
<!-- 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 }}" />
|
||||
{% if page.share-img %}
|
||||
<meta property="og:image" content="{{ page.share-img }}" />
|
||||
{% elsif site.avatar %}
|
||||
<meta property="og:image" content="{{ site.url }}{{ site.avatar }}" />
|
||||
{% else %}
|
||||
<meta property="og:image" content="" />
|
||||
{% endif %}
|
||||
|
||||
<!-- Twitter summary cards -->
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:site" content="@{{ site.author.twitter }}" />
|
||||
<meta name="twitter:creator" content="@{{ site.author.twitter }}" />
|
||||
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" />
|
||||
<meta name="twitter:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}" />
|
||||
<meta name="twitter:image" content="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg" />
|
||||
{% if page.share-img %}
|
||||
<meta name="twitter:image" content="{{ page.share-img }}" />
|
||||
{% elsif site.avatar %}
|
||||
<meta name="twitter:image" content="{{ site.url }}{{ site.avatar }}" />
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue