<!-- adapted from sphinx_rtd_theme versions.html -->

<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-book"> Versions</span>
        {{ building_version }}
        <span class="fa fa-caret-down"></span>
    </span>
    <div class="rst-other-versions">
        <dl>
            {% set prefix = pagename | list | select("equalto", "/") | map("replace", "/", "../") | join("") %}
            {% if building_version == "latest" %}
                <dd>latest</dd>
            {% else %}
                <dd><a href="{{ prefix }}../{{ pagename }}.html">latest</a></dd>
            {% endif %}

            {% for release in releases.split(";") | sort(True) %}
                {% if building_version == release %}
                    <dd>{{ release }}</dd>
                {% elif building_version == "latest" %}
                    <dd><a href="{{ prefix }}{{ release }}/{{ pagename }}.html">{{ release }}</a></dd>
                {% else %}
                    <dd><a href="{{ prefix }}../{{ release }}/{{ pagename }}.html">{{ release }}</a></dd>
                {% endif %}
            {% endfor %}
        </dl>
    </div>
</div>
