45 lines
1.6 KiB
Twig
45 lines
1.6 KiB
Twig
{% set currentUrl = site.url ~ page.url|trim('/', 'right') %}
|
|
{% set pageTitle = page.title %}
|
|
{% set siteTitle = site.name %}
|
|
|
|
{% if not page.is_front %}
|
|
{% set pageTitle = [page.title, '-', site.name]|join(' ') %}
|
|
{% endif %}
|
|
|
|
{% set metaDescription = site.description %}
|
|
{% if page.meta.description %}
|
|
{% set metaDescription = page.meta.description|e('html') %}
|
|
{% elseif page.description %}
|
|
{% set metaDescription = page.description|e('html') %}
|
|
{% elseif page.excerpt %}
|
|
{% set metaDescription = page.excerpt|e('html') %}
|
|
{% endif %}
|
|
|
|
{% set metaImage = [
|
|
site.url,
|
|
'/',
|
|
page.meta.image ?? site.avatar.url,
|
|
]|join %}
|
|
|
|
<title>{{ pageTitle }}</title>
|
|
<link rel="canonical" href="{{ currentUrl }}" />
|
|
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<meta property="og:site_name" content="{{ siteTitle }}" />
|
|
<meta property="og:title" content="{{ pageTitle }}" />
|
|
<meta property="og:type" content="website" />
|
|
<meta property="og:url" content="{{ currentUrl }}" />
|
|
|
|
<meta name="description" content="{{ metaDescription }}">
|
|
<meta name="og:description" content="{{ metaDescription }}">
|
|
<meta name="twitter:description" content="{{ metaDescription }}">
|
|
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
<meta name="twitter:image" content="{{ metaImage }}" />
|
|
<meta name="twitter:image:alt" content="Page image for {{ site.name }}" />
|
|
<meta property="og:image" content="{{ metaImage }}" />
|
|
<meta property="og:image:alt" content="Page image for {{ site.name }}" />
|