Skip to content

Commit

Permalink
add links to the footer
Browse files Browse the repository at this point in the history
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 <ruth.fuchss@canonical.com>
  • Loading branch information
ru-fu committed Apr 27, 2023
1 parent 4bca131 commit ab94976
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
21 changes: 16 additions & 5 deletions .sphinx/_templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,34 @@
{%- endtrans -%}
</div>
{%- endif %}
</div>
<div class="right-details">

{# ru-fu: replaced RTD icons with our links #}

{%- if show_source and has_source and sourcename %}
<div class="show-source">
<a class="muted-link" href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">Show source</a>
</div>
{%- endif %}
</div>
<div class="right-details">

{# ru-fu: replaced RTD icons with our links #}

{% if discourse %}
<div class="ask-discourse">
<a class="muted-link" href="{{ discourse }}">Ask a question on Discourse</a>
</div>
{% endif %}

{% if github_url and github_version and github_folder and github_filetype %}
<div class="issue-github">
<a class="muted-link" href="{{ github_url }}/issues/new?title=doc%3A+ADD+A+TITLE&body=DESCRIBE+THE+ISSUE%0A%0A---%0ADocument: {{ pagename }}.{{ github_filetype }}">Open a GitHub issue for this page</a>
</div>
<div class="edit-github">
<a class="muted-link" href="{{ github_url }}/edit/{{ github_version }}{{ github_folder }}{{ pagename }}.{{ github_filetype }}">Edit on GitHub</a>
<a class="muted-link" href="{{ github_url }}/edit/{{ github_version }}{{ github_folder }}{{ pagename }}.{{ github_filetype }}">Edit this page on GitHub</a>
</div>
{% endif %}


</div>
</div>
</div>
6 changes: 5 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@

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",
"github_folder": "/",
"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

Expand Down

0 comments on commit ab94976

Please sign in to comment.