Adds versioning HTML to the docs

This commit is contained in:
Saptak S 2020-09-01 01:34:24 +05:30
parent beb4964b4a
commit e05415b4c0
No known key found for this signature in database
GPG Key ID: 2D9B32E54C68A3FB
3 changed files with 42 additions and 1 deletions

View File

@ -1 +0,0 @@
<h1>Languages</h1>

View File

@ -0,0 +1,25 @@
<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">OnionShare</span>
v: {{ current_version }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
{%- if versions %}
<dl>
<dt>{{ _('Versions') }}</dt>
{%- for name, url in versions %}
<dd><a href="{{ url }}">{{ name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
{%- if langs %}
<dl>
<dt>{{ _('Languages') }}</dt>
{%- for name, code in langs %}
<dd><a href="../{{ code }}/">{{ name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
</div>
</div>

View File

@ -10,10 +10,27 @@ extensions = ["sphinx_rtd_theme"]
templates_path = ["_templates"] templates_path = ["_templates"]
exclude_patterns = [] exclude_patterns = []
languages = [
("العربية", "ar"),
("Català", "ca"),
("Dansk", "da"),
("Nederlands", "nl"),
("English", "en"),
]
versions = [
("2.3", "/")
]
html_theme = "sphinx_rtd_theme" html_theme = "sphinx_rtd_theme"
html_logo = "_static/logo.png" html_logo = "_static/logo.png"
html_favicon = "_static/favicon.ico" html_favicon = "_static/favicon.ico"
html_theme_options = {} html_theme_options = {}
html_context = {
"langs": languages,
"versions": versions,
"current_version": release
}
html_static_path = ["_static"] html_static_path = ["_static"]
html_css_files = ["custom.css"] html_css_files = ["custom.css"]
html_show_sourcelink = False html_show_sourcelink = False