Skip to content

Commit b32f04d

Browse files
committed
Add version switcher
1 parent 841d89f commit b32f04d

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

docs/_static/switcher.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[
2+
{
3+
"name": "6 (stable)",
4+
"version": "6.0",
5+
"url": "https://6.docs.plone.org/"
6+
},
7+
{
8+
"version": "5",
9+
"url": "https://5.docs.plone.org/"
10+
},
11+
{
12+
"version": "4",
13+
"url": "https://4.docs.plone.org/"
14+
},
15+
{
16+
"version": "3",
17+
"url": "https://3.docs.plone.org/"
18+
}
19+
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{%- for sidebartemplate in sidebars %}
2+
{%- include sidebartemplate %}
3+
{%- endfor %}
4+
{%- include 'version-switcher.html' -%}

docs/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,25 @@
229229
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_use_opensearch
230230
html_use_opensearch = "https://6.docs.plone.org"
231231

232+
html_sidebars = {
233+
"**": [
234+
"sidebar-logo.html",
235+
"search-field.html",
236+
"sbt-sidebar-nav.html",
237+
]
238+
}
239+
232240
html_theme_options = {
233241
"path_to_docs": "docs",
234242
"repository_url": "https://github.com/plone/documentation",
235243
"repository_branch": "main",
236244
"use_repository_button": True,
237245
"use_issues_button": True,
238246
"use_edit_page_button": True,
247+
"switcher": {
248+
"json_url": "/_static/switcher.json",
249+
"version_match": version,
250+
},
239251
"extra_navbar": """
240252
<p class="ploneorglink">
241253
<a href="https://plone.org">

0 commit comments

Comments
 (0)