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>
|
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.title }}</title>
|
||||||
<meta name="description" content="{{ page.description }}">
|
<meta name="description" content="{{ page.description }}">
|
||||||
<meta name="keywords" content="{{ page.tags | join: ', ' }}">
|
<meta name="keywords" content="{{ page.tags | join: ', ' }}">
|
||||||
{% if site.owner.twitter %}<!-- Twitter Card and Open Graph meta -->
|
{% if site.owner.twitter %}<!-- Twitter Cards -->
|
||||||
<meta name="twitter:title" content="{% if page.title %}{{ page.title }} – {% endif %}{{ site.title }}">
|
{% if page.image.feature %}<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ page.content | strip_html | strip_newlines | truncate: 120 }}{% endif %}">
|
<meta name="twitter:image" content="{{ site.url }}/images/{{ page.image.feature }}">
|
||||||
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">
|
{% else %}<meta name="twitter:card" content="summary">
|
||||||
{% if page.layout == 'photo' %}
|
<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:card" content="photo">
|
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
|
||||||
{% if page.image %}<meta name="twitter:image:src" content="{{ site.url }}/images/{{ page.image.feature }}">{% endif %}
|
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
|
||||||
{% else %}
|
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">{% endif %}
|
||||||
<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 %}
|
<!-- Open Graph -->
|
||||||
<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 %}
|
|
||||||
<meta property="og:locale" content="en_US">
|
<meta property="og:locale" content="en_US">
|
||||||
<meta property="og:title" content="{% if page.title %}{{ page.title }} – {% endif %}{{ site.title }}">
|
<meta property="og:type" content="article">
|
||||||
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ page.content | strip_html | strip_newlines | truncate: 120 }}{% endif %}">
|
<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:url" content="{{ site.url }}{{ page.url }}">
|
||||||
<meta property="og:site_name" content="{{ site.title }}">
|
<meta property="og:site_name" content="{{ site.title }}">
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue