From ab94976599008c078e81c01cb763dff046bfb347 Mon Sep 17 00:00:00 2001 From: Ruth Fuchss Date: Fri, 21 Apr 2023 16:15:23 +0200 Subject: [PATCH] add links to the footer Add community engagement links to the footer - "Ask a question" (link to Discourse) and "Open an issue" (same as the "Give feedback" button at the top). Signed-off-by: Ruth Fuchss --- .sphinx/_templates/footer.html | 21 ++++++++++++++++----- conf.py | 6 +++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.sphinx/_templates/footer.html b/.sphinx/_templates/footer.html index b7c93e08..d1409fff 100644 --- a/.sphinx/_templates/footer.html +++ b/.sphinx/_templates/footer.html @@ -53,10 +53,6 @@ {%- endtrans -%} {%- endif %} - -
- - {# ru-fu: replaced RTD icons with our links #} {%- if show_source and has_source and sourcename %}
@@ -64,12 +60,27 @@ rel="nofollow">Show source
{%- endif %} +
+
+ + {# ru-fu: replaced RTD icons with our links #} + + {% if discourse %} + + {% endif %} + {% if github_url and github_version and github_folder and github_filetype %} + {% endif %} +
diff --git a/conf.py b/conf.py index 17b000b2..6fc708d3 100644 --- a/conf.py +++ b/conf.py @@ -21,7 +21,7 @@ html_context = { # Change to the discourse instance you want to be able to link to - "discourse_prefix": "https://discourse.ubuntu.com/t/", + "discourse": "https://discourse.ubuntu.com", # Change to the GitHub info for your project "github_url": "https://github.com/canonical/starter-pack", "github_version": "main", @@ -29,6 +29,10 @@ "github_filetype": "rst" } +# Used for related links - no need to change +if 'discourse' in html_context: + html_context['discourse_prefix'] = html_context['discourse'] + "/t/" + # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration