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 %} +
+ Ask a question on Discourse +
+ {% endif %} + {% if github_url and github_version and github_folder and github_filetype %} +
+ Open a GitHub issue for this page +
- Edit on GitHub + Edit this page on GitHub
{% 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