From 6576951737bb97d12ed1637f692eda2c283e8865 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 15 Jul 2025 09:54:32 +0200 Subject: [PATCH] fix: Show custom version select Signed-off-by: Joas Schilling --- admin_manual/_templates/versions.html | 25 +++++++++++++++++++++++ admin_manual/conf.py | 4 +++- conf.py | 2 ++ developer_manual/_templates/versions.html | 25 +++++++++++++++++++++++ developer_manual/conf.py | 4 +++- 5 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 admin_manual/_templates/versions.html create mode 100644 developer_manual/_templates/versions.html diff --git a/admin_manual/_templates/versions.html b/admin_manual/_templates/versions.html new file mode 100644 index 000000000..70c5e22de --- /dev/null +++ b/admin_manual/_templates/versions.html @@ -0,0 +1,25 @@ +{% if READTHEDOCS %} +{# Add rst-badge after rst-versions for small badge style. #} +
+ + ☁️ {{ current_version }} + + +
+
+
☁️ {{ _('Versions') }}
+ {% for slug, url in versions|reverse %} +
+ + {{ slug }} + +
+ {% endfor %} +
+
+
+{% endif %} \ No newline at end of file diff --git a/admin_manual/conf.py b/admin_manual/conf.py index 1a469042a..f84811b75 100644 --- a/admin_manual/conf.py +++ b/admin_manual/conf.py @@ -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 = '' diff --git a/conf.py b/conf.py index f4467bde3..341f2f461 100644 --- a/conf.py +++ b/conf.py @@ -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. diff --git a/developer_manual/_templates/versions.html b/developer_manual/_templates/versions.html new file mode 100644 index 000000000..70c5e22de --- /dev/null +++ b/developer_manual/_templates/versions.html @@ -0,0 +1,25 @@ +{% if READTHEDOCS %} +{# Add rst-badge after rst-versions for small badge style. #} +
+ + ☁️ {{ current_version }} + + +
+
+
☁️ {{ _('Versions') }}
+ {% for slug, url in versions|reverse %} +
+ + {{ slug }} + +
+ {% endfor %} +
+
+
+{% endif %} \ No newline at end of file diff --git a/developer_manual/conf.py b/developer_manual/conf.py index a0fa8cfb0..a02e9f850 100644 --- a/developer_manual/conf.py +++ b/developer_manual/conf.py @@ -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 = ''