{% extends "base.html" %}
{% block announce %}
<span style="display:flex; justify-content:space-between">
<span class="show-on-small">
    <span class="twemoji right-margin show-on-small move-down">
        {% include ".icons/fontawesome/solid/angles-down.svg" %}
    </span>
    Navigate the site here!
</span>
<span>
    Newest release: <a style="vertical-align: middle;" href="https://pypi.org/project/sweetbean/">
        <img src="https://img.shields.io/pypi/v/sweetbean" alt="PyPI">
    </a>
</span>
<span>
    <span class="twemoji">
        {% include ".icons/material/head-question.svg" %}
    </span>
    Issues or Feature requests?
    <a href="https://github.com/AutoResearch/sweetbean/issues">
        Open an issue!
    </a>
</span>
</span>
{% endblock %}

{% block content %}
<div style="position: relative;">
    {% if page.nb_url %}
    <a href="{{ page.canonical_url }}{{ page.file.src_uri | basename | quote }}"
       title="Download {{ page.file.src_uri | basename | escape }}"
       class="md-content__button md-icon"
       style="position: absolute; right: 0; top: 0;"
       download="{{ page.file.src_uri | basename }}">
        {% include ".icons/material/download.svg" %}
    </a>
    {% if page.file.src_uri.endswith('.ipynb') %}
    <a href="{{ config.extra.colab_base_url }}{{ page.url }}{{ page.file.src_uri | basename | quote }}"
       title="Open Notebook in Google Colab" class="md-content__button md-icon"
       style="position: absolute; right: 50px; top: 0;">
        <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
    </a>
    <br>
    {% endif %}
</div>

{% endif %}
{{ super() }}
{% if page.nb_url %}
{% if page.file.src_uri.endswith('.py') %}
<a href="{{ page.nb_url.rsplit('/', 1)[0] + '.html' }}">Test it here!</a>
{% endif %}
{% endif %}
{% endblock content %}