fix: Show custom version select

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling
2025-07-15 09:54:32 +02:00
parent 842935712e
commit 6576951737
5 changed files with 58 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
{% if READTHEDOCS %}
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
☁️ {{ current_version }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>☁️ {{ _('Versions') }}</dt>
{% for slug, url in versions|reverse %}
<dd style="width: 32%">
<a href="{{ url }}"
{% if current_version == slug %}
style="color: var(--dark-link-color);"
{% endif %}
>
{{ slug }}
</a>
</dd>
{% endfor %}
</dl>
</div>
</div>
{% endif %}

View File

@@ -32,7 +32,7 @@ from conf import *
extensions += ['sphinx.ext.todo', 'rst2pdf.pdfbuilder', 'sphinx.ext.intersphinx']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['../_shared_assets/templates']
templates_path = ['../_shared_assets/templates', '_templates']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -61,6 +61,8 @@ project = u'Nextcloud %s Administration Manual' % (version)
# for a list of supported languages.
#language = None
language = 'en'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''

View File

@@ -8,6 +8,8 @@ dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.abspath(dir_path + '/_ext'))
now = datetime.datetime.now()
os.environ["READTHEDOCS"] = "True"
extensions = ['sphinx_rtd_theme', 'sphinx_rtd_dark_mode', 'sphinx_copybutton']
# General information about the project.

View File

@@ -0,0 +1,25 @@
{% if READTHEDOCS %}
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
☁️ {{ current_version }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>☁️ {{ _('Versions') }}</dt>
{% for slug, url in versions|reverse %}
<dd style="width: 32%">
<a href="{{ url }}"
{% if current_version == slug %}
style="color: var(--dark-link-color);"
{% endif %}
>
{{ slug }}
</a>
</dd>
{% endfor %}
</dl>
</div>
</div>
{% endif %}

View File

@@ -32,7 +32,7 @@ from conf import *
extensions += ['sphinx.ext.todo', 'rst2pdf.pdfbuilder', 'sphinx.ext.intersphinx', 'sphinxcontrib.phpdomain', 'sphinx_toolbox.collapse', 'sphinx_reredirects']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['../_shared_assets/templates']
templates_path = ['../_shared_assets/templates', '_templates']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -60,6 +60,8 @@ project = u'Nextcloud %s Developer Manual' % (version)
# for a list of supported languages.
#language = None
language = 'en'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''