Skip to content

Commit ce801d5

Browse files
authored
Merge pull request plone#1387 from plone/version-switcher
Add version switcher
2 parents c75989e + 8ac10f8 commit ce801d5

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
@@ -225,13 +225,25 @@
225225
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_use_opensearch
226226
html_use_opensearch = "https://6.docs.plone.org"
227227

228+
html_sidebars = {
229+
"**": [
230+
"sidebar-logo.html",
231+
"search-field.html",
232+
"sbt-sidebar-nav.html",
233+
]
234+
}
235+
228236
html_theme_options = {
229237
"path_to_docs": "docs",
230238
"repository_url": "https://github.com/plone/documentation",
231239
"repository_branch": "main",
232240
"use_repository_button": True,
233241
"use_issues_button": True,
234242
"use_edit_page_button": True,
243+
"switcher": {
244+
"json_url": "/_static/switcher.json",
245+
"version_match": version,
246+
},
235247
"extra_navbar": """
236248
<p class="ploneorglink">
237249
<a href="https://plone.org">

0 commit comments

Comments
 (0)