{# -*- coding: utf-8 -*-

  This file is part of Invenio.
  Copyright (C) 2015-2018 CERN.
  Copyright (C) 2021 New York University.

  Invenio 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{% if html_css_classes %} class="{{ html_css_classes|join(' ') }}"{% endif %} 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) or _('Invenio') %}
      <title>{{title}}</title>
    {%- endblock head_title %}

    {%- block head_links %}
      <link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='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 %}

      {%- block head_apple_icons %}
        {%- for size in [120, 152, 167, 180] %}
          {%- set icon_name = 'apple-touch-icon-%d.png' | format(size) %}
          <link rel="apple-touch-icon" sizes="{{ size }}x{{ size }}" href="{{ url_for('static', filename=icon_name) }}"/>
        {%- endfor %}
      {%- endblock head_apple_icons %}

    {%- endblock head_links %}

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

      {%- block css %}
      {{ webpack['theme.css'] }}
      <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
      <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
      <![endif]-->
      {%- endblock css %}
    {%- endblock head %}
  </head>

  <body{% if body_css_classes %} class="{{ body_css_classes|join(' ') }}"{% endif %}{% if g.ln %} lang="{{ g.ln.split('_', 1)[0]|safe }}"{% if rtl_direction %} {{ rtl_direction|safe }}{% endif %}{% endif %} itemscope itemtype="http://schema.org/WebPage" data-spy="scroll" data-target=".scrollspy-target">

    {%- block body %}

      {%- block bypasslinks %}
      <a id="skip-to-main" class="ui button primary ml-5 mt-5 skip-link" href="#main">{{_('Skip to main')}}</a>
      {%- endblock bypasslinks %}

      {%- block browserupgrade %}
      <!--[if lt IE 8]>
        <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 %}

        <main id="main">
        <div class="invenio-page-body">
          {%- block page_body %}
            {% include "invenio_theme/body.html" %}
          {%- endblock page_body %}
        </div>
        </main>

        {%- 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>
