Skip to content

Commit

Permalink
Add template blocks for an RTD-like version switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
maeve-fpf committed Jan 7, 2022
1 parent f7eeddc commit 1a0519c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/_static/releases.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.rst-other-versions .current-release { font-weight: 700; }
35 changes: 35 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% extends "!layout.html" %}

{% block extrahead %}
<link rel="stylesheet" href="_static/releases.css" type="text/css" />
{% endblock %}

{% block extrabody %}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book">SecureDrop Docs</span>
v: {{ release }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>Versions</dt>
<dd{% if release == "stable" %} class="current-release"{% endif %}>
<a href="/en/stable/{{ pagename }}.html">stable</a>
</dd>
<dd{% if release == "latest" %} class="current-release"{% endif %}>
<a href="/en/latest/{{ pagename }}.html">latest</a>
</dd>
</dl>
<dl>
<dt>Downloads</dt>
<dd><a href="/en/{{ release }}/SecureDrop.pdf">PDF</a></dd>
</dl>
<hr>
<small>
A project of <a href="https://freedom.press/">Freedom of the Press Foundation</a> ·
<a href="https://freedom.press/privacy-policy/">Privacy Policy</a>
</small>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down

0 comments on commit 1a0519c

Please sign in to comment.