<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    {# Site title #}
    <title>{{ macros_set_title::set_title() }}</title>

    {# Favicon #}
    {% if config.extra.favicon %}
        <link rel="icon" type="image/png" href={{ config.extra.favicon }} />
    {% endif %}

    {# RSS #}
    <link rel="alternate" type="application/atom+xml" title="{{ config.title }}" href="{{ get_url(path="atom.xml",
        trailing_slash=false) }}">
    <link rel="stylesheet" type="text/css" media="screen" href={{ get_url(path="main.css" ) }} />

    {% if config.extra.stylesheets %}
        {% for stylesheet in config.extra.stylesheets %}
            <link rel="stylesheet" href="{{ get_url(path=stylesheet) }}">
        {% endfor %}
    {% endif %}

    <meta name="description" content="{{ config.description }}">
    {% if is_404 %}
        <meta name="robots" content="noindex, follow">
    {% else %}
        <meta name="robots" content="index, nofollow">
    {% endif %}

    <meta property="og:title" content="{{ config.title }}">
    <meta property="og:type" content="article" />

    {% if config.extra.headerImage %}
        <meta property="og:image" content="{{ config.extra.headerImage }}">
        <meta name="twitter:card" content="{{ config.extra.headerImage }}">
    {% endif %}

    {% set current_url = current_url | default(value="/") %}
    <meta property="og:url" content="{{ current_url }}">
    
    <meta property="og:description" content="{{ config.description }}">
    <meta property="og:site_name" content="{{ config.title }}">

    <meta http-equiv="Content-Security-Policy"
    content="default-src 'self'
    {%- if config.extra.allowed_domains -%}
    ; 
        {%- for domain in config.extra.allowed_domains -%}
            {{ domain.directive }} {{ domain.domains | join(sep=' ') }}
            {%- if not loop.last -%}
            ;
            {%- endif -%}
        {%- endfor -%}
    {%- endif -%}">

    {%- if config.extra.theme_switcher == true -%}
        <script type="text/javascript" src="{{ get_url(path='js/initialize_theme_min.js') | safe }}"></script>
        <script defer src="{{ get_url(path='js/main_min.js', trailing_slash=false) | safe }}"/></script>
    {%- endif -%}

</head>
