{% set ogp = module('V2_Ogp') %}
{% set blogField = module('V2_Blog_Field') %}

<meta charset="UTF-8" />
{% if touch('Touch_Entry') %}
  <link rel="canonical" href="{{ PERMALINK }}" />
{% endif %}

<title>
  {{ ogp.title }}
</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
{{ include('/include/head/robots.twig') }}
<meta property="og:url" content="{{ PERMALINK }}" />
<meta property="og:site_name" content="{{ ROOT_BLOG_NAME }}" />
<meta property="og:title" content="{{ ogp.title }}" />
<meta property="og:type" content="{{ ogp.type }}" />

{% if ogp.description %}
  <meta property="og:description" content="{{ ogp.description|mb_trim(350, '...')|delnl|escape }}" />
{% endif %}
{% if ogp.image %}
  <meta property="og:image" content="{{ ogp.image }}" />
  <meta property="og:image:secure_url" content="{{ ogp.image }}" />
  <meta property="og:image:width" content="{{ ogp['image@x'] }}" />
  <meta property="og:image:height" content="{{ ogp['image@y'] }}" />
{% endif %}
{% if ogp.description %}
  <meta name="description" content="{{ ogp.description|mb_trim(350, '...')|delnl|escape }}" />
{% endif %}
{% if ogp.keywords %}
  <meta name="keywords" content="{{ ogp.keywords }}" />
{% endif %}

<meta name="twitter:title" content="{{ ogp.title }}" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:domain" content="{{ DOMAIN }}" />
{% if ogp.image %}
  <meta name="twitter:image" content="{{ ogp.image }}" />
{% endif %}
{% if blogField.fields.twitter_creator %}
  <meta name="twitter:creator" content="@{{ blogField.fields.twitter_creator.value }}" />
{% endif %}

{% if blogField.fields.google_site_verification %}
  <meta name="google-site-verification" content="{{ blogField.fields.google_site_verification.value }}" />
{% endif %}
