{#
  Copyright (C) 2020-2023 Graz University of Technology.

  invenio-theme-iform is free software; you can redistribute it and/or
  modify it under the terms of the MIT License; see LICENSE file for more
  details.
#}

<!doctype html>
<html lang="{{ current_i18n.locale.language|safe }}" dir="{{ current_i18n.locale.text_direction }}">
    <head>
        {%- block head %}
            {%- block head_meta %}
                <meta charset="utf-8" />
                <meta http-equiv="X-UA-Compatible" content="IE=edge" />
                <meta name="viewport" content="width=device-width, initial-scale=1" />

                {%- if description %}
                    <meta name="description" content="{{ description }}" />
                {% endif %}

                {%- if keywords %}
                    <meta name="keywords" content="{{ keywords }}" />
                {% endif %}

                {%- if config.get("THEME_GOOGLE_SITE_VERIFICATION", None) %}
                    {%- for google_id in config.THEME_GOOGLE_SITE_VERIFICATION %}
                        <meta name="google-site-verification" content="{{ google_id }}" />
                    {%- endfor %}
                {%- endif %}
            {%- endblock head_meta %}

            {%- block head_title %}
                {%- set title = title or config.THEME_SITENAME %}
                <title>{{ title }}</title>
            {%- endblock head_title %}

            {%- block head_links %}
                <link rel="shortcut icon" href="{{ url_for('static', filename=config.THEME_FAVICON or 'images/iform-favicon.ico') }}" />

                {%- if keywords %}
                    <link rel="canonical" href="{{ canonical_url }}" />
                {% endif %}

                {%- block head_links_langs %}
                    {%- if alternate_urls %}
                        {%- for alt_ln, alternate_url in alternate_urls.items() %}
                            <link
                                rel="alternate"
                                hreflang="{{ alt_ln }}"
                                href="{{ alternate_url }}"
                            />
                        {%- endfor %}
                    {%- endif %}
                {%- endblock %}
            {%- endblock head_links %}

            {%- block header %}
            {% endblock header %}

            {%- block css %}
                {{ webpack["theme.css"] }}
                {{ webpack["invenio-theme-iform-theme.css"] }}
            {%- endblock css %}
        {%- endblock head %}
    </head>

    <body
        itemscope
        itemtype="http://schema.org/WebPage"
        data-spy="scroll"
        data-target=".scrollspy-target"
    >
        {%- block body %}
            {%- block browserupgrade %}
                <!--[if lt IE 10]>
                    <p class="browserupgrade">
                        You are using an <strong>outdated</strong> browser. Please
                        <a href="http://browsehappy.com/">upgrade your browser</a> to improve your
                        experience.
                    </p>
                <![endif]-->
            {%- endblock browserupgrade %}

            {%- block body_inner %}
                {%- block page_header %}
                    {% include config.THEME_HEADER_TEMPLATE %}
                {%- endblock page_header %}

                {%- block page_body %}
                    {% include "invenio_theme/body.html" %}
                {%- endblock page_body %}

                {%- block page_footer %}
                    {% include config.THEME_FOOTER_TEMPLATE %}
                {%- endblock page_footer %}
            {%- endblock body_inner %}

            {%- block javascript %}
                {% include config.THEME_JAVASCRIPT_TEMPLATE %}
            {%- endblock javascript %}

            {%- block trackingcode %}
                {% include config.THEME_TRACKINGCODE_TEMPLATE %}
            {%- endblock %}
        {%- endblock body %}
    </body>
</html>
