<!DOCTYPE html>
<html lang="en">
  <head>
    <title>{% if eleventyNavigation.title %}{{ eleventyNavigation.title }} | {% endif %}Codeberg Documentation</title>

    <meta charset="UTF-8">
    {% if description %}<meta name="description" content="{{ description }}">{% endif %}
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="icon" type="image/svg+xml" href="/assets/images/logo/codeberg-favicon.svg" sizes="250x250">

    <link rel="preload" type="text/css" href="/assets/css/codeberg-docs.css">
    <link rel="preload" href="https://fonts.codeberg.org/dist/inter/Inter Web/inter.css" as="style">
    <link rel="preload" href="https://fonts.codeberg.org/dist/fontawesome5/css/solid.min.css" as="style">
    <link rel="preload" href="https://fonts.codeberg.org/dist/fontawesome5/css/fontawesome.min.css" as="style">

    <link rel="stylesheet" type="text/css" href="/assets/css/codeberg-docs.css" async>
    <link rel="stylesheet" type="text/css" href="/assets/css/prism-nord.css" async>

    <!-- Details and License: https://fonts.codeberg.org/fonts/inter -->
    <link rel="stylesheet" type="text/css" href="https://fonts.codeberg.org/dist/inter/Inter Web/inter.css" async>

    <!-- Details and License: https://fonts.codeberg.org/fonts/fontawesome5 -->
    <link rel="stylesheet" type="text/css" href="https://fonts.codeberg.org/dist/fontawesome5/css/solid.min.css" async>
    <link rel="stylesheet" type="text/css" href="https://fonts.codeberg.org/dist/fontawesome5/css/fontawesome.min.css" async>

    <script type="text/javascript" src="/assets/js/collapse.js"></script>
    <script type="text/javascript" src="/assets/js/sidebar.js"></script>
  </head>

  <body>
    <div id="sidebar-overlay" onclick="javascript:hideSidebar()"></div>
    <header>
      <div class="container">
        <div id="header-logo">
          <a href="/">
            <div id="header-logo-container">
              <img src="/assets/images/logo/codeberg-favicon.svg" alt="Codeberg">
              <div id="logo-heading">Documentation</div>
            </div>
          </a>
        </div>
        <div class="action-buttons" id="header-action-buttons">
          <!--<a href="#">{% fas_icon "globe-europe" %} English</a>-->
          <a href="{{ urls.commitHistoryMaster }}/{{ page.inputPath }}" target="_blank">{% fas_icon "history" %} View History</a>
          <a href="{{ urls.docsSourcesMaster }}/{{ page.inputPath }}" target="_blank">{% fas_icon "code" %} View Source</a>
          <a href="#" id="contents-button" onclick="toggleSidebar()">{% fas_icon "bars" %}</a>
        </div>
        <div id="mobile-contents-button"><a href="#" onclick="toggleSidebar()">{% fas_icon "bars" %}</a></div>
      </div>
    </header>

    <main>
      <div class="container">
        <div id="sidebar">
          <nav>
            <div class="sidebar-close-button"><a href="javascript:void(0)" onclick="hideSidebar()">{% fas_icon "times-circle" %}</a></div>

            <ul>
              {% for entry in collections.all | eleventyNavigation %}
                {% set active = entry.url == page.url or entry.key == eleventyNavigation.parent %}
                {% if (not entry.draft) or active %}
                  <li class="nav-section{% if active %} active{% endif %}" style="display: flex;">
                    <a class="section-link" href="{{ entry.url }}" style="flex: 1;">{% fas_icon entry.icon | default("caret-right") %} {{ entry.title }}</a>
                    {% if entry.children.length > 0 %}
                      <a class="section-collapse-button" data-collapse-id="nav-second-level-{{ entry.key }}" href="javascript:void(0)" onclick="onCollapseButtonClick(this)">
                        {% if active %}{% fas_icon "minus-square" %}{% else %}{% fas_icon "plus-square" %}{% endif %}
                      </a>
                    {% else %}
                      <a class="section-collapse-button"><!-- Intentionally left blank --></a>
                    {% endif %}
                  </li>
                  {% if entry.children.length > 0 %}
                    <li class="nav-second-level collapsible" id="nav-second-level-{{ entry.key }}"{% if not active %} style="max-height: 0px;"{% endif %}>
                      <ul>
                        {% for child in entry.children %}
                          {% set child_active = child.url == page.url %}
                          {% if child_active or not child.draft %}
                            <li><a href="{{ child.url }}"{% if child_active %} class="active"{% endif %}>{{ child.title }}</a></li>
                          {% endif %}
                        {% endfor %}
                      </ul>
                    </li>
                  {% endif %}
                {% endif %}
              {%- endfor %}
            </ul>
          </nav>
        </div>

        <div class="flex-spacer"></div>

        <article>
          {% if eleventyNavigation.title %}<h1>{{ eleventyNavigation.title }}</h1>{% endif %}
          {% if eleventyNavigation.draft %}<strong>Please note that this article is still a draft and might not have any contents yet.</strong>{% endif %}
          {{ content | safe }}
          {% if page.url != '/' %}{% include 'contribution_invitation.njk' %}{% endif %}
        </article>
      </div>

      <div class="action-buttons" id="mobile-action-buttons">
        <!--<a href="#">{% fas_icon "globe-europe" %} English</a>-->
        <a href="{{ urls.commitHistoryMaster }}/{{ page.inputPath }}" target="_blank">{% fas_icon "history" %} View History</a>
        <a href="{{ urls.docsSourcesMaster }}/{{ page.inputPath }}" target="_blank">{% fas_icon "code" %} View Source</a>
      </div>
    </main>

    <footer>
        This Website by <a href="{{ urls.docsSourcesMaster }}/CONTRIBUTORS.md">The Codeberg Documentation Contributors</a> is licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">CC-BY-SA 4.0</a>.
        It bundles third-party font software licensed under a different license.
        Please look at <a href="{{ urls.docsSourcesMaster }}/LICENSE.md">the LICENSE file</a> for details.<br>

        Changes to the original versions of the article as well as its individual authors can be looked up in <a href="{{ urls.commitHistoryMaster }}/{{ page.inputPath }}" target="_blank">this article's commit history</a><br>

        Codeberg and the Codeberg Logo are trademarks of Codeberg e.V.<br>

        For Imprint, Privacy Policy and other legal notices, please refer to <a href="https://codeberg.org">https://codeberg.org</a>.
    </footer>
  </body>
</html>
