{#

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.

We need to generate the target URL differently based on the type
of page.  We use the built-in `pagename` variable to determine what
kind of page this is.  `pagename` is the path at the end of the
URL, without the extension.  For instance,
https://pvlib-python.rtfd.org/en/stable/auto_examples/plot_singlediode.html
will have pagename = "auto_examples/plot_singlediode".

Note: make_github_url is defined in conf.py
#}

{% extends "!breadcrumbs.html" %}
{% block breadcrumbs_aside %}
    <li class="wy-breadcrumbs-aside">
        {# Get the appropriate GH link based on this page's name: #}
        {% set target_url = make_github_url(pagename) %}
        {# Create the HTML element with our custom GH link: #}
        <a href="{{ target_url }}" class="fa fa-github">View on Github</a>
    </li>
{% endblock %}
