{% extends "@Components/layout-base/layout-base.twig" %}
{% block meta %}
{% set robots = 'all' %}
{% if meta.noIndex and meta.noFollow %}
{% set robots = 'noindex, nofollow' %}
{% elseif meta.noIndex %}
{% set robots = 'noindex, follow' %}
{% elseif meta.noFollow %}
{% set robots = 'index, nofollow' %}
{% endif %}
<meta name="robots" content="{{ robots }}">
{% if meta.description %}
<meta name="description" content="{{ meta.description }}" />
{% endif %}
{% if meta.keywords %}
<meta name="keywords" content="{{ meta.keywords }}" />
{% endif %}
{% if meta.canonicalUrl %}
<link rel="canonical" href="{{ meta.canonicalUrl }}" />
<meta property="og:url" content="{{ meta.canonicalUrl }}" />
<meta name="twitter:url" content="{{ meta.canonicalUrl }}" />
{% endif %}
{# OG #}
{% if meta.locale %}
<meta property="og:locale" content="{{ meta.locale|getLanguageFromLocale }}" />
{% endif %}
{% if meta.siteName %}
<meta property="og:site_name" content="{{ meta.siteName }}" />
{% endif %}
{% if meta.ogTitle %}
<meta property="og:title" content="{{ meta.ogTitle }}" />
{% endif %}
{% if meta.ogDescription %}
<meta property="og:description" content="{{ meta.ogDescription }}" />
{% endif %}
{% if meta.published %}
<meta property="article:published_time" content="{{ meta.published|date(constant('\DateTime::ATOM')) }}" />
{% endif %}
<meta property="og:type" content="website" />
{% if meta.ogImages %}
{% set ogImages = sulu_resolve_medias(meta.ogImages, locale) %}
{% for image in ogImages %}
<meta property="og:image" content="{{ absolute_url(image.thumbnails['1200x630']) }}" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
{% endfor %}
{% endif %}
{# TWITTER #}
<meta name="twitter:card" content="summary_large_image" />
{% if meta.twitterTitle %}
<meta name="twitter:title" content="{{ meta.twitterTitle }}" />
{% endif %}
{% if meta.twitterDescription %}
<meta name="twitter:description" content="{{ meta.twitterDescription }}" />
{% endif %}
{% if meta.twitterImages %}
{% set twitterImages = sulu_resolve_medias(meta.twitterImages, locale) %}
{% for image in twitterImages %}
<meta property="twitter:image" content="{{ absolute_url(image.thumbnails['800x400']) }}" />
{% endfor %}
{% endif %}
{% endblock %}
{% block title %}
{% if meta.title and meta.siteName %}
{% set title = meta.title ~ ' - ' ~ meta.siteName %}
{% elseif meta.title %}
{% set title = meta.title %}
{% elseif meta.siteName %}
{% set title = meta.siteName %}
{% endif %}
{{ title }}
{% endblock %}
{% set alertItems = [] %}
{% for type, messages in app.flashes() %}
{% for message in messages %}
{% set alertItems = alertItems|merge([
{
variant: type,
content: message,
}
]) %}
{% endfor %}
{% endfor %}
{% if alertItems %}
{% set alerts = {
items: alertItems
} %}
{% endif %}