{# Modify the "Edit on Github" links to handle auto-generated pages in 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://rdtools.rtfd.io/en/latest/generated/rdtools.soiling.soiling_srr.html will have pagename = "generated/rdtools.soiling.soiling_srr". Note: make_github_url is defined in conf.py #} {% extends "!breadcrumbs.html" %} {% block breadcrumbs_aside %} {# Get the appropriate GH link based on this page's name: #} {% set link_info = make_github_url(pagename) %} {# Create the HTML element with our custom GH link, unless it couldn't be determined. Note that None is lowercase in templates. #} {% if link_info is not none %}