{# Basic metadata #}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<html lang="fr">

{# Schema #}
<style itemscope itemtype="https://schema.org/WebSite" itemref="schema_name schema_description schema_image"></style>

{# Title #}
<title>{{ site.title }} | {{ page.title }}</title>
<meta id="schema_name" itemprop="name" content="{{ site.title }} | {{ page.title }}">

{# Description #}
{% if page.meta_description is not empty %}
	<meta name="description" content="{{ page.meta_description }}">
	<meta id="schema_description" itemprop="description" content="{{ page.meta_description }}">
{% elseif site.homePage.meta_description is not empty %}
	<meta name="description" content="{{ site.homePage.meta_description }}">
	<meta id="schema_description" itemprop="description" content="{{ site.homePage.meta_description }}">
{% endif %}

{# Canonical URL #}
<link rel="canonical" href="{{ page.url }}">

{# Author #}
<meta name="author" content="{{ site.title }}">

{# Date #}
<meta name="date" content="{{ page.modified('Y-m-d') }}">

{# Image #}
{% if page.meta_image is not empty %}
<meta id="schema_image" itemprop="image" content="{{ page.meta_image.toImage.url }}">
{% elseif site.homePage.meta_image is not empty %}
<meta id="schema_image" itemprop="image" content="{{ site.homePage.meta_image.toImage.url }}">
{% endif %}

{% if page.template != 'error' %}

	{# Open Graph #}
	<meta property="og:title" content="{{ site.title ~ ' | ' ~ page.title }}">
	{% if page.meta_description is not empty %}
		<meta property="og:description" content="{{ page.meta_description }}">
	{% elseif site.homePage.meta_description is not empty %}
		<meta property="og:description" content="{{ site.homePage.meta_description }}">
	{% endif %}
	{% if page.meta_image is not empty %}
		<meta property="og:image" content="{{ page.meta_image.toImage.clip(1200, 675).url }}">
		<meta property="og:image:width" content="1200">
		<meta property="og:image:height" content="675">
	{% elseif site.homePage.meta_image is not empty %}
		<meta property="og:image" content="{{ site.homePage.meta_image.toImage.clip(1200, 675).url }}">
		<meta property="og:image:width" content="1200">
		<meta property="og:image:height" content="675">
	{% endif %}
	<meta property="og:url" content="{{ page.url }}">
	<meta property="og:type" content="{{ page.og_type }}">

	{# Twitter Card #}
	<meta name="twitter:card" content="{{ page.twitter_card_type.value }}">
	<meta name="twitter:title" content="{{ site.title ~ ' | ' ~ page.title }}">
	{% if page.meta_description is not empty %}
		<meta name="twitter:description" content="{{ page.meta_description }}">
	{% elseif site.homePage.meta_description is not empty %}
		<meta name="twitter:description" content="{{ site.homePage.meta_description }}">
	{% endif %}
	{% if page.meta_image is not empty %}
		<meta name="twitter:image" content="{{ page.meta_image.toImage.clip(1200, 675).url }}">
	{% elseif site.homePage.meta_image is not empty %}
		<meta name="twitter:image" content="{{ site.homePage.meta_image.toImage.clip(1200, 675).url }}">
	{% endif %}

{% endif %}
