Skip to content

Commit

Permalink
Fix Github edit links in top-right of HTML pages
Browse files Browse the repository at this point in the history
These links 404'd because they omitted the file suffix, and they didn't really
link to anything editable, just the raw file.

---

In this case, "suffix" was used which is set by the readthedocs theme in
older versions [1]. Seem good to replace with page_source_suffix.

[1] readthedocs/sphinx_rtd_theme#1104
  • Loading branch information
ckreibich authored and awelzel committed Nov 3, 2023
1 parent f5c61d8 commit 2b12b2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/_templates/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% if pagename != "search" %}
{% if display_github %}
{% if github_version == "master" %}
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/edit/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ page_source_suffix }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
{% endif %}
{% elif show_source and has_source and sourcename %}
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> {{ _('View page source') }}</a>
Expand Down

0 comments on commit 2b12b2f

Please sign in to comment.