Skip to content

Commit

Permalink
Modernise the edit-this-page.html template
Browse files Browse the repository at this point in the history
This now uses the current `basic-ng` template for determining when
and how to present the edit button.
  • Loading branch information
pradyunsg committed Sep 29, 2022
1 parent 5a0ceca commit 509c558
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/furo/theme/furo/components/edit-this-page.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% extends "basic-ng/components/edit-this-page.html" %}
{% from "basic-ng/components/edit-this-page.html" import determine_page_edit_link with context %}

{%- macro furo_edit_button(url) -%}
Expand All @@ -13,15 +14,14 @@
</div>
{%- endmacro -%}

{% block link_available -%}
{{ furo_edit_button(determine_page_edit_link()) }}
{%- endblock %}

{%- if theme_source_repository -%}
{%- if not theme_source_branch -%}
{{ warning("Provided `source_repository` but not `source_branch`. ")}}
{%- endif -%}
{%- if page_source_suffix -%}
{{ furo_edit_button(determine_page_edit_link()) }}
{%- endif -%}
{%- elif READTHEDOCS and conf_py_path and page_source_suffix and github_user != "None" and github_repo != "None" and github_version %}
{% block link_not_available %}
{# Make nice things happen, on Read the Docs #}
{%- if READTHEDOCS and conf_py_path and page_source_suffix and github_user != "None" and github_repo != "None" and github_version and pagename and page_source_suffix %}
{% set url = "https://github.com/" + github_user + "/" + github_repo + "/edit/" + github_version + conf_py_path + pagename + page_source_suffix %}
{{ furo_edit_button(url) }}
{%- endif -%}
{% endblock %}

0 comments on commit 509c558

Please sign in to comment.