Add Twitter Card summary large image
This commit is contained in:
parent
0a71132bff
commit
cf8f714bd8
1 changed files with 13 additions and 15 deletions
|
@ -2,22 +2,20 @@
|
|||
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.title }}</title>
|
||||
<meta name="description" content="{{ page.description }}">
|
||||
<meta name="keywords" content="{{ page.tags | join: ', ' }}">
|
||||
{% if site.owner.twitter %}<!-- Twitter Card and Open Graph meta -->
|
||||
<meta name="twitter:title" content="{% if page.title %}{{ page.title }} – {% endif %}{{ site.title }}">
|
||||
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ page.content | strip_html | strip_newlines | truncate: 120 }}{% endif %}">
|
||||
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">
|
||||
{% if page.layout == 'photo' %}
|
||||
<meta name="twitter:card" content="photo">
|
||||
{% if page.image %}<meta name="twitter:image:src" content="{{ site.url }}/images/{{ page.image.feature }}">{% endif %}
|
||||
{% else %}
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:image:src" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/default-thumb.png{% endif %}">{% endif %}
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:image" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/default-thumb.png{% endif %}">
|
||||
{% endif %}
|
||||
{% if site.owner.twitter %}<!-- Twitter Cards -->
|
||||
{% if page.image.feature %}<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ site.url }}/images/{{ page.image.feature }}">
|
||||
{% else %}<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:image" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/{{ site.logo }}{% endif %}">{% endif %}
|
||||
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
|
||||
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
|
||||
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">{% endif %}
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta property="og:title" content="{% if page.title %}{{ page.title }} – {% endif %}{{ site.title }}">
|
||||
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ page.content | strip_html | strip_newlines | truncate: 120 }}{% endif %}">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
|
||||
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
|
||||
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
|
||||
<meta property="og:site_name" content="{{ site.title }}">
|
||||
|
||||
|
|
Loading…
Reference in a new issue