Even more flexible edit link #471
-
Currently, there is a huge switch in https://github.com/pradyunsg/sphinx-basic-ng/blob/main/src/sphinx_basic_ng/theme/basic-ng/components/edit-this-page.html to implement some edit links (#114) I would like to suggest that this be made more flexible, and I believe it would not come as a huge maintenance cost Some sample code how it could be done, by adding a template setting variable: diff --git a/src/furo/theme/furo/theme.conf b/src/furo/theme/furo/theme.conf
index c9f2eefd..1d39cc2e 100644
--- a/src/furo/theme/furo/theme.conf
+++ b/src/furo/theme/furo/theme.conf
@@ -23,6 +23,7 @@ sidebar_hide_name =
footer_icons =
top_of_page_button = edit
# For components/edit-this-page.html
+source_repository_link =
source_repository =
source_branch =
source_directory = Then, in ...
{%- if theme_source_repository_link and page_source_suffix and not meta['generated'] -%}
{% set url = theme_source_repository_link|format(pagename + page_source_suffix) %}
{{ furo_edit_button(url) }}
{%- elif theme_source_repository -%}
... Usage would also be rather simple: in html_theme_options['source_repository_link'] = 'https://my.repo.forge/myorg/myrepo/blob/mybranch/%s?plain=1' |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This will come with pradyunsg/sphinx-basic-ng#34. |
Beta Was this translation helpful? Give feedback.
-
I would close this as resolved by #510. |
Beta Was this translation helpful? Give feedback.
This will come with pradyunsg/sphinx-basic-ng#34.