]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Docs: Synchronise ``indexsidebar.html`` with docsbuild-scripts (#132567)
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>
Tue, 15 Apr 2025 22:27:01 +0000 (23:27 +0100)
committerGitHub <noreply@github.com>
Tue, 15 Apr 2025 22:27:01 +0000 (23:27 +0100)
Doc/tools/templates/_docs_by_version.html [new file with mode: 0644]
Doc/tools/templates/indexsidebar.html

diff --git a/Doc/tools/templates/_docs_by_version.html b/Doc/tools/templates/_docs_by_version.html
new file mode 100644 (file)
index 0000000..1a84cfb
--- /dev/null
@@ -0,0 +1,11 @@
+{#
+This file is only used in indexsidebar.html, where it is included in the docs
+by version list. For non-end-of-life branches, build_docs.py overwrites this
+list with the full list of versions.
+
+Keep the following two files synchronised:
+* cpython/Doc/tools/templates/_docs_by_version.html
+* docsbuild-scripts/templates/_docs_by_version.html
+#}
+<li><a href="https://docs.python.org/3/">{% trans %}Stable{% endtrans %}</a></li>
+<li><a href="https://docs.python.org/dev/">{% trans %}In development{% endtrans %}</a></li>
index 5986204256f4bc49979602b95a4428b208437d7c..eea29e2449a9cf3801c346e834fb0c774d7bbce0 100644 (file)
@@ -2,11 +2,10 @@
 <p><a href="{{ pathto('download') }}">{% trans %}Download these documents{% endtrans %}</a></p>
 <h3>{% trans %}Docs by version{% endtrans %}</h3>
 <ul>
-  <li><a href="https://docs.python.org/">{% trans %}Stable{% endtrans %}</a></li>
-  <li><a href="https://docs.python.org/dev/">{% trans %}In development{% endtrans %}</a></li>
+  {# _docs_by_version.html is overwritten by build_docs.py for non-EOL versions #}
+  {% include "_docs_by_version.html" without context %}
   <li><a href="https://www.python.org/doc/versions/">{% trans %}All versions{% endtrans %}</a></li>
 </ul>
-
 <h3>{% trans %}Other resources{% endtrans %}</h3>
 <ul>
   {# XXX: many of these should probably be merged in the main docs #}