Add default meta tag content

This commit is contained in:
Oliver Davies 2017-05-08 21:30:35 +01:00
parent c1d2e43b1d
commit 4420f5f73e
2 changed files with 9 additions and 8 deletions

View file

@ -9,9 +9,7 @@
<meta name="description" content="{{ page.meta.description|e('html') }}">
{% endif %}
{% if page.meta.og %}
{% include 'og' with { og: page.meta.og } %}
{% endif %}
{% include 'og' with { og: page.meta.og } %}
<link rel="stylesheet" href="{{ site.url }}/assets/css/site.css">
{% block styles %}{% endblock %}

View file

@ -1,8 +1,5 @@
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
{% if og.title %}
<meta property="og:title" content="{{ og.title|raw }}"/>
{% endif %}
<meta property="og:title" content="{{ og.title ? og.title|raw : page.title|raw }}"/>
{% if og.description %}
<meta property="og:description" content="{{ og.description|raw }}"/>
@ -23,16 +20,22 @@
{% if og.image.height %}
<meta property="og:image:height" content="{{ og.image.height }}"/>
{% endif %}
{% else %}
<meta property="og:image" content="{{ site.url }}{{ site.avatar.url }}"/>
<meta property="og:image:height" content="327"/>
<meta property="og:image:type" content="image/jpg">
<meta property="og:image:width" content="327"/>
{% endif %}
{% if og.title %}
{% if og.image %}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image:src" content="{{ site.url }}{{ og.image.url }}">
<meta name="twitter:creator" content="@{{ site.twitter.name }}"/>
{% else %}
<meta name="twitter:card" content="summary"/>
<meta name="twitter:image:src" content="{{ site.url }}{{ site.avatar.url }}">
{% endif %}
<meta name="twitter:creator" content="@{{ site.twitter.name }}"/>
<meta name="twitter:title" content="{{ og.title|raw }}"/>
<meta name="twitter:text:description" content="{{ og.description|raw }}"/>
<meta name="twitter:site" content="@{{ site.twitter.name }}"/>