<!--
 Copyright 2023 Winford (Uncle Grumpy) <winford@object.stream>

 SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

 Based on the work of  Michael Altfield:
 https://tech.michaelaltfield.net/2020/07/18/sphinx-rtd-github-pages-1
-->

{% if READTHEDOCS or display_lower_left %}
{# Add rst-badge after rst-versions for small badge style. #}
  <div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
    <span class="rst-current-version" data-toggle="rst-current-version">
      <span class="fa fa-download"></span><span class="fa fa-book"> AtomVM Docs version:</span>
      {{ current_version }}
      <span class="fa fa-caret-down"></span>
    </span>
    <div class="rst-other-versions">
      {% if versions|length >= 1 %}
      <dl>
        <dt><span class="fa fa-book">{{ _(' Versions') }}</span></dt>
        {% for slug, url in versions %}
          {% if slug == current_version %} <strong> {% endif %}
          <dd><a href="{{ url }}">{{ slug }}</a></dd>
          {% if slug == current_version %} </strong> {% endif %}
        {% endfor %}
      </dl>
      {% endif %}
      {% if downloads|length >= 1 %}
      <dl>
        <dt><span class="fa fa-download">{{ _(' Downloads') }}</span></dt>
        {% for type, url in downloads %}
          <dd><a href="{{ url }}">{{ type }}</a></dd>
        {% endfor %}
      </dl>
      {% endif %}
    </div>
  </div>
{% endif %}
