<!DOCTYPE html>
<html {% if currentpage.lang %}lang="{{target.lang}}"{% endif %}>
<head>
  {% block headtag %}
    <title>{{ currentpage.name }} - {{target.display_name}}</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width">

    <!-- Blocking JS resources -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

    <!-- Stylesheet -->
    {% if currentpage.stylesheet is undefined %}
      {% set stylesheet = "https://dactyl.link/template_assets/dactyl.css" %}
    {% else %}
      {% set stylesheet = currentpage.stylesheet %}
    {% endif %}
    <link href="{{stylesheet}}" rel="stylesheet" />

    {% block googleanalytics %}
      {% if target.google_analytics_tag is defined %}
      <!-- Google Analytics -->
      <script async src="https://www.googletagmanager.com/gtag/js?id={{target.google_analytics_tag}}"></script>
      <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('configure', '{{target.google_analytics_tag}}');
      </script>
      {% endif %}
    {% endblock %}

    {% block head %}

    {% endblock %}
  {% endblock %}
</head>

<body class="{% if currentpage.sidebar is undefined or currentpage.sidebar == "both" %}sidebar-both{% elif currentpage.sidebar == "left_only" %}sidebar-left{% elif currentpage.sidebar == "right_only" %}sidebar-right{% elif currentpage.sidebar == "disabled" %}sidebar-disabled{% endif %} {% if target.lang is defined %}lang-{{target.lang}}{% endif %} {% block bodyclasses %}{% endblock %}" data-spy="scroll" data-target="#page-toc-wrapper" data-offset="0">
  {% block topnav %}
    {% include 'header.html' %}
  {% endblock %}

  {% block mainbody %}
  <div class="container-fluid" role="document" id="main_content_wrapper">
    <div class="row">
      <!-- Right sidebar first so it's at the beginning for mobile layouts -->
      {% if currentpage.sidebar is undefined or (currentpage.sidebar != "disabled" and currentpage.sidebar != "left_only") %}
      <aside class="right-sidebar col-lg-3 order-lg-4" role="complementary">
          {% block right_sidebar %}{% endblock %}
      </aside>
      {% endif %}

      <!-- main column -->
      <main class="main {% if currentpage.sidebar is defined and currentpage.sidebar == "disabled" %}col-md-12{% elif currentpage.sidebar == "left_only" %}col-md-7 col-lg-9{% elif currentpage.sidebar == "right_only" %}col-md-12 col-lg-9{% else %}col-md-7 col-lg-6{% endif %} order-md-3  {% block mainclasses %}{% endblock %}" role="main" id="main_content_body">
          {% block breadcrumbs %}
            {% include 'breadcrumbs.html' %}
          {% endblock %}
          {% block main %}
            <section class="pt-3 p-md-3">
              <article class="dactyl-content">
                {{ content }}
              </article>
            </section>
          {% endblock %}
      </main>
      {% if currentpage.sidebar is undefined or (currentpage.sidebar != "disabled" and currentpage.sidebar != "right_only") %}
      <!-- Left sidebar last so it's at the end for mobile -->
      <aside class="sidebar col-md-5 col-lg-3 order-md-1" role="complementary">
          {% block left_sidebar %}
            {% include "tree-nav.html" %}
          {% endblock %}
      </aside>
      {% endif %}
    </div><!--/.row (main layout)-->
  </div>
  {% endblock %}

{% block footer %}
  {% include 'footer.html' %}
{% endblock %}

{% block nonblockingresources %}
<!-- Non-blocking resources -->
<!-- Bootstrap JS -->
{% if currentpage.bootstrapjs is undefined %}
  {% set bootstrapjs = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" %}
{% else %}
  {% set bootstrapjs = currentpage.bootstrapjs %}
{% endif %}
<script src="{{bootstrapjs}}"></script>
<!-- Dactyl JS -->
{% if currentpage.dactyljs is undefined %}
  {% set dactyljs = "https://dactyl.link/template_assets/dactyl.js" %}
{% else %}
  {% set dactyljs = currentpage.dactyljs %}
{% endif %}
<script src="{{dactyljs}}"></script>
<!-- fontawesome icons -->
{% if currentpage.fontawesomecss is undefined %}
  {% set fontawesomecss = "https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" %}
{% else %}
  {% set fontawesomecss = currentpage.fontawesomecss %}
{% endif %}
<link rel="stylesheet" href="{{fontawesomecss}}" />
{% endblock %}

{% block endbody %}{% endblock %}
</body>
</html>
