-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
“Edit this page” → “Edit on GitHub/GitLab/Bitbucket” (#1177)
* “Edit this page” → “Edit on GitHub/GitLab/Bitbucket” Fixes #1172 * Add tests * Fix typo
- Loading branch information
Showing
4 changed files
with
102 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/edit-this-page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
{% 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="fa-solid fa-pencil"></i> {{ _("Edit this page") }} | ||
<a href="{{ get_edit_provider_and_url()[1] }}"> | ||
<i class="fa-solid fa-pencil"></i> | ||
{% set provider = get_edit_provider_and_url()[0] %} | ||
{% block edit_this_page_text %} | ||
{% if provider %} | ||
{% trans provider=provider %}Edit on {{ provider }}{% endtrans %} | ||
{% else %} | ||
{% trans %}Edit{% endtrans %} | ||
{% endif %} | ||
{% endblock %} | ||
</a> | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters