diff --git a/changelogs/internal/newsfragments/2256.clarification b/changelogs/internal/newsfragments/2256.clarification new file mode 100644 index 00000000..468f55d5 --- /dev/null +++ b/changelogs/internal/newsfragments/2256.clarification @@ -0,0 +1 @@ +Add version picker in the navbar. diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 4b817cd0..b09b9562 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -78,6 +78,10 @@ current_version_url = "https://spec.matrix.org/latest" # major = "1" # minor = "16" +[[params.versions]] +# We must include this parameter to enable docsy's version picker in the navbar. The picker +# is populated automatically in navbar-version-selector.html. + # User interface configuration [params.ui] # Collapse HTTP API and event
elements diff --git a/layouts/_partials/navbar-version-selector.html b/layouts/_partials/navbar-version-selector.html new file mode 100644 index 00000000..bd678239 --- /dev/null +++ b/layouts/_partials/navbar-version-selector.html @@ -0,0 +1,28 @@ +{{- /* + + A version of the navbar-version-selector.html partial in Docsy, + modified to read the versions from changelog child pages so that + we don't have to maintain the menu separately in hugo.toml. + +*/ -}} + +{{ $changelog := site.GetPage "changelog" }} +{{ $pages := $changelog.RegularPages.ByDate.Reverse }} + +