<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
          integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <title>{{ page_title | escape }}{% if page_title %} &laquo; {% endif %}{{ web_log.name | escape }}</title>
    {% page_head -%}
  </head>
  <body>
    <header>
      <nav class="navbar navbar-light bg-light navbar-expand-md justify-content-start px-2">
        <div class="container-fluid">
          <a class="navbar-brand" href="{{ "" | relative_link }}">{{ web_log.name }}</a>
          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText"
                  aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarText">
            {% if web_log.subtitle -%}
              <span class="navbar-text">{{ web_log.subtitle.value | escape }}</span>
            {%- endif %}
            {% if page_list -%}
              <ul class="navbar-nav">
                {% for pg in page_list -%}
                  {{ pg.permalink | nav_link: pg.title }}
                {%- endfor %}
              </ul>
            {%- endif %}
            {% user_links %}
          </div>
        </div>
      </nav>
    </header>
    <main class="mx-3">
      {% if messages %}
        <div class="messages">
          {% for msg in messages %}
            <div role="alert" class="alert alert-{{ msg.level }} alert-dismissible fade show">
              {{ msg.message }}
              <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
              {% if msg.detail %}
                <hr>
                <p>{{ msg.detail.value }}</p>
              {% endif %}
            </div>
          {% endfor %}
        </div>
      {% endif %}
      {{ content }}  
    </main>
    <footer>
      <hr>
      <div class="container-fluid text-end">
        <img src="/img/logo-dark.png" alt="myWebLog">
      </div>
    </footer>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
            integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
            crossorigin="anonymous"></script>
  </body>
</html>
