Skip to content

Commit d6c5e6f

Browse files
committed
BUG - call get_edit_provider_and_url() only once
Signed-off-by: Martin Matous <[email protected]>
1 parent 3e74810 commit d6c5e6f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/_templates/edit-this-page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% if sourcename is defined and theme_use_edit_page_button and page_source_suffix %}
22
{% set src = sourcename.split('.') %}
33
<div class="tocsection editthispage">
4-
<a href="{{ to_main(get_edit_provider_and_url()[1]) }}">
4+
{% set provider, url = get_edit_provider_and_url() %}
5+
<a href="{{ to_main(url) }}">
56
<i class="fa-solid fa-pencil"></i>
6-
{% set provider = get_edit_provider_and_url()[0] %}
77
{% block edit_this_page_text %}
88
{% if provider %}
99
{% trans provider=provider %}Edit on {{ provider }}{% endtrans %}

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/edit-this-page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
{% if sourcename is defined and theme_use_edit_page_button==true and page_source_suffix %}
33
{% set src = sourcename.split('.') %}
44
<div class="tocsection editthispage">
5-
<a href="{{ get_edit_provider_and_url()[1] }}">
5+
{% set provider, url = get_edit_provider_and_url() %}
6+
<a href="{{ url }}">
67
<i class="fa-solid fa-pencil"></i>
7-
{% set provider = get_edit_provider_and_url()[0] %}
88
{% block edit_this_page_text %}
99
{% if provider %}
1010
{% trans provider=provider %}Edit on {{ provider }}{% endtrans %}

0 commit comments

Comments
 (0)