{#

Modify the "Edit on Github" links to handle auto-generated pages in the
example gallery and the API reference listings.  The GH links that sphinx
generates by default make the assumption that an HTML file comes from an RST
file with the same filepath, which isn't the case for autogenerated files. The
logic to generate the correct URL is in conf.py, but we still have to modify
the template here to change the "Edit this page" text to "View on GitHub".

#}

{% if sourcename is defined and theme_use_edit_page_button==true and page_source_suffix %}
{% set src = sourcename.split('.') %}
<div class="tocsection editthispage">
    <a href="{{ get_edit_url() }}">
        <i class="fab fa-github-square"></i> {{ _("View on GitHub") }}
    </a>
</div>
{% endif %}
