add twitter card support
This commit is contained in:
parent
4374062885
commit
07a3a21be4
@ -1,27 +1,46 @@
|
|||||||
<head>
|
<head>
|
||||||
|
|
||||||
|
{% capture title %}
|
||||||
|
{% if page.title %}
|
||||||
|
{{ page.title }}
|
||||||
|
{% else %}
|
||||||
|
Andrew Cassidy
|
||||||
|
{% endif %}
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
|
{% capture description %}
|
||||||
|
{% if page.description%}
|
||||||
|
{{ page.description}}
|
||||||
|
{% else %}
|
||||||
|
{{page.content | markdownify | strip_html | truncate: 100}}
|
||||||
|
{% endif %}
|
||||||
|
{% endcapture %}
|
||||||
|
{{site.url}}/images/{{page.path | split: '/' | last | split: '.' | first }}/{{page.image}}
|
||||||
|
{% capture image %}
|
||||||
|
|
||||||
|
|
||||||
<meta charset=utf-8 />
|
<meta charset=utf-8 />
|
||||||
<title> {% if page.title %} {{ page.title }} | {% endif %} Andrew Cassidy</title>
|
<title> {% if page.title %} {{ page.title }} | {% endif %} Andrew Cassidy</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<meta property="og:title"
|
|
||||||
content="{% if page.title %} {{ page.title }} {% else %} Andrew Cassidy's Website {% endif %}"/>
|
<!-- Twitter cards -->
|
||||||
<meta property="og:url" content="{{site.url}}{{page.url}}"/>
|
<meta name="twitter:card" content="summary"/>
|
||||||
|
<meta name="twitter:site" conten="@AndrewNCassidy"/>
|
||||||
|
<meta name="twitter:title" content="{{title}}"/>
|
||||||
|
<meta name="twitter:description" content="{{description}}"/>
|
||||||
|
|
||||||
{% if page.image %}
|
{% if page.image %}
|
||||||
<meta property="og:image"
|
<meta name="twitter:image" content="{{image}}"/>
|
||||||
content="{{site.url}}/images/{{page.path | split: '/' | last | split: '.' | first }}/{{page.image}}"/>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.description %}
|
<!-- Opengraph -->
|
||||||
<meta
|
<meta property="og:url" content="{{site.url}}{{page.url}}"/>
|
||||||
property="og:description"
|
<meta property="og:title" content="{{title}}"/>
|
||||||
content="{{page.description}}"
|
<meta property="og:image" content="{{description}}"/>
|
||||||
/>
|
|
||||||
{% else %}
|
{% if page.image %}
|
||||||
<meta
|
<meta property="og:image" content="{{image}}"/>
|
||||||
property="og:description"
|
|
||||||
content="{{page.content | markdownify | strip_html | truncate: 100}}"
|
|
||||||
/>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.collection == "posts" %}
|
{% if page.collection == "posts" %}
|
||||||
|
Loading…
Reference in New Issue
Block a user