From 1a88e2c13ad4dc040276cfb87f17d13e82bdbaf0 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Fri, 29 Nov 2024 14:43:36 -0800 Subject: [PATCH] Fix "Edit on Github" links Fix the "Edit on Github" links by removing the `_templates/breadcrumbs.html` file: Sphinx and the RTD theme can generate those links if the docs are correctly configured. Add `"conf_py_path"` to the `html_context` dictionary in Sphinx configuration file, so the links to the source files work correctly. Minor updates on the configuration file to avoid some warnings: remove the `language=None` and `html_theme_path`. --- _templates/breadcrumbs.html | 43 ------------------------------------- conf.py | 11 ++-------- 2 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 _templates/breadcrumbs.html diff --git a/_templates/breadcrumbs.html b/_templates/breadcrumbs.html deleted file mode 100644 index a1ede30e..00000000 --- a/_templates/breadcrumbs.html +++ /dev/null @@ -1,43 +0,0 @@ -{# Support for Sphinx 1.3+ page_source_suffix, but don't break old builds. #} - -{% set css_files = css_files + [ "_static/css/theme_overrides.css" ] %} - -{% if page_source_suffix %} -{% set suffix = page_source_suffix %} -{% else %} -{% set suffix = source_suffix %} -{% endif %} - -{% if meta is defined and meta is not none %} -{% set check_meta = True %} -{% else %} -{% set check_meta = False %} -{% endif %} - -{% if check_meta and 'github_url' in meta %} -{% set display_github = True %} -{% endif %} - -{% if check_meta and 'bitbucket_url' in meta %} -{% set display_bitbucket = True %} -{% endif %} - -
- -
-
diff --git a/conf.py b/conf.py index 2953bcba..7eafccf8 100644 --- a/conf.py +++ b/conf.py @@ -78,13 +78,6 @@ # The full version, including alpha/beta/rc tags. release = '0.0.5' -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' @@ -164,12 +157,12 @@ import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_context = { 'display_github': True, 'github_user': 'geoscixyz', 'github_repo': 'em', - 'github_version': 'main' + 'github_version': 'main', + "conf_py_path": "/", # Path in the checkout to the docs root } # The name for this set of Sphinx documents. If None, it defaults to # " v documentation".