{% include 2017/meta-vars.html page=page %}
<meta charset='utf-8'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<link href='{{ base }}/assets/favicon.png' rel='shortcut icon'>
<meta content='{{ page.url }}' name='app:pageurl'>

{% if meta_title %}
  <title>{{ meta_title }}</title>
  <meta content='{{ meta_title }}' property='og:title'>
  <meta content='{{ meta_title }}' property='twitter:title'>
  <meta content='{{ page.og_type | default: "article" }}' property='og:type'>
{% endif %}

{% if meta_image %}
  <meta content='{{ meta_image | escape }}' property='og:image'>
  <meta content='{{ meta_image | escape }}' property='twitter:image'>
  <meta content='900' property='og:image:width'>
  <meta content='471' property='og:image:height'>
{% endif %}

{% if meta_description %}
  <meta content="{{ meta_description | escape }}" name="description">
  <meta content="{{ meta_description | escape }}" property="og:description">
  <meta content="{{ meta_description | escape }}" property="twitter:description">
{% endif %}

<link rel="canonical" href="{{ page_url }}">
<meta name="og:url" content="{{ page_url }}">
{% if page.url == '/' %}
  <link rel="prefetch" href="{{ site.url }}">
  <link rel="prerender" href="{{ site.url }}">
{% endif %}

{% if page.author %}
{% for author in site.authors | where: "name", page.author %}
  <meta content='{{ author.name }}' name='author'>
  {% if author.ogp %}
  <meta content='{{ author.ogp }}' property='article:author'>
  {% endif %}
{% endfor %}
{% endif %}

{% if site.title %}
  <meta content='{{ site.title }}' property='og:site_name'>
{% endif %}

{% if site.facebook.app_id %}
  <meta content='{{ site.facebook.app_id }}' property='fb:app_id'>
{% endif %}

{% if site.facebook.admin %}
  <meta content='{{ site.facebook.admin }}' property='fb:admins'>
{% endif %}

{% if page.date %}
  <meta content='{{ page.date | date: "%Y-%m-%d" }}' property='article:published_date'>
{% endif %}

{% if page.category %}
  <meta content='{{ page.category }}' property='article:section'>
{% endif %}

{% if page.tags %}
{% for tag in page.tags %}
  <meta content='{{ tag }}' property='article:tag'>
{% endfor %}
{% endif %}

{% if site.data.google_analytics.enabled %}
<script async src='https://www.googletagmanager.com/gtag/js?id={{ site.data.google_analytics.id }}'></script>
<script>
{% comment %} if(~location.hostname.indexOf('{{site.data.google_analytics.hostname}}')){ {% endcomment %}
window.dataLayer=window.dataLayer||[];
function gtag(){dataLayer.push(arguments)};
gtag('js',new Date());
gtag('config','{{ site.data.google_analytics.id }}');
</script>
{% endif %}

{% if depth %}
  <meta property='page:depth' content='{{depth}}'>
{% endif %}

<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
<script>(function(H){H.className=H.className.replace(/\bNoJs\b/,'WithJs')})(document.documentElement)</script>
