From b932d301d7838f3c1a50e318e216b55ce5cc9148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 30 Mar 2025 23:32:23 +0200 Subject: [PATCH] docs: fix oddities in sidebar menu configuration #1081 --- .../configuration/sidebar/menus/_index.en.md | 29 ++++++++++++++++--- .../partials/_relearn/defaultSidebar.gotmpl | 2 +- .../_relearn/defaultSidebarFooter.gotmpl | 2 +- .../_relearn/defaultSidebarHeader.gotmpl | 2 +- layouts/partials/version.txt | 2 +- 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/docs/content/configuration/sidebar/menus/_index.en.md b/docs/content/configuration/sidebar/menus/_index.en.md index 6aa4fa2751..b2c32c914e 100644 --- a/docs/content/configuration/sidebar/menus/_index.en.md +++ b/docs/content/configuration/sidebar/menus/_index.en.md @@ -227,26 +227,47 @@ If you don't set these options in your `hugo.toml`, the theme defaults as follow - `sidebarheadermenus`: - a divider to separate from the logo (depending on the color configuration of the theme variant) if any of the following is configured - - a home button if [configured](configuration/sidebar/headerfooter#home-button-configuration), if you redefine this, use a Hugo menu and a `type=menu` to replicate this + - a home button if [configured](configuration/sidebar/headerfooter#home-button-configuration), see notes below + - a divider - the version switcher if versioning is [configured](configuration/sitemanagement/versioning) - a divider to separate from the `sidebarmenus` (depending on the color configuration of the theme variant) - `sidebarmenus`: - the main page menu based on your [content structure](authoring/structure) - - the `shortcuts` menu including the title if [configured](#predefined-shortcuts-menu) + - the `shortcuts` menu including the title if [configured](#predefined-shortcuts-menu), see notes below - `sidebarfootermenus`: - a divider to separate from the `sidebarmenus` if any of the following is configured - the language switcher if multilingual is [configured](configuration/sitemanagement/multilingual#turn-off-language-switching) - the variant switcher if multiple variants are [configured](configuration/branding/colors/#multiple-variants) - the history clearer if you [configured](configuration/sidebar/headerfooter#history) to mark visited pages + +This comes down to the following pseudo default configuration. + {{< multiconfig section=params >}} +sidebarheadermenus = [ + { type = 'divider' }, + { type = 'menu', identifier = 'homelinks', disableTitle = true }, + { type = 'divider' }, + { type = 'custom', identifier = 'headercontrols', elements = [ { type = 'versionswitcher' } ] }, + { type = 'divider' } +] + +sidebarmenus = [ + { type = 'page', identifier = 'main' }, + { type = 'menu', identifier = 'shortcuts', disableTitle = false } +] + sidebarfootermenus = [ { type = 'divider' }, - { type = 'custom', elements = [ { type = 'historyclearer' }, { type = 'variantswitcher' }, { type = 'languageswitcher' } ] } + { type = 'custom', identifier = 'footercontrols', elements = [ { type = 'historyclearer' }, { type = 'variantswitcher' }, { type = 'languageswitcher' } ] } ] {{< /multiconfig >}} -and no multilingual configuration is configured, the language switcher will be shown non the less. +Notes: + +- multiple consecutive dividers are removed by the theme if no other content is in between them +- if you redefine the `homelinks` like displayed above, you have to define a Hugo menu to replicate the implicit default configuration +- for the `shortcuts` if the implicit default configuration is active, the value for `disableTitle` will be determined by your [configuration for `disableShortcutsTitle`](#predefined-shortcuts-menu). ### Page Menu diff --git a/layouts/partials/_relearn/defaultSidebar.gotmpl b/layouts/partials/_relearn/defaultSidebar.gotmpl index 2609b02045..64ba5f32a5 100644 --- a/layouts/partials/_relearn/defaultSidebar.gotmpl +++ b/layouts/partials/_relearn/defaultSidebar.gotmpl @@ -1,7 +1,7 @@ {{- $defaultmenuconfigs := slice }} {{- $defaultmenuconfigs = $defaultmenuconfigs | append - (dict "type" "page" "identifier" "home") + (dict "type" "page" "identifier" "main") }} {{- $defaultmenuconfigs = $defaultmenuconfigs | append diff --git a/layouts/partials/_relearn/defaultSidebarFooter.gotmpl b/layouts/partials/_relearn/defaultSidebarFooter.gotmpl index d2b60738f4..b14feaf1c3 100644 --- a/layouts/partials/_relearn/defaultSidebarFooter.gotmpl +++ b/layouts/partials/_relearn/defaultSidebarFooter.gotmpl @@ -7,7 +7,7 @@ {{- $defaultconfigelements = $defaultconfigelements | append (dict "type" "variantswitcher") }} {{- $defaultconfigelements = $defaultconfigelements | append (dict "type" "historyclearer") }} {{- $defaultmenuconfigs = $defaultmenuconfigs | append - (dict "type" "custom" "identifier" "controls" "disableTitle" true "elements" $defaultconfigelements) + (dict "type" "custom" "identifier" "footercontrols" "elements" $defaultconfigelements) }} {{- return $defaultmenuconfigs }} \ No newline at end of file diff --git a/layouts/partials/_relearn/defaultSidebarHeader.gotmpl b/layouts/partials/_relearn/defaultSidebarHeader.gotmpl index 144f2ce6d2..362200f430 100644 --- a/layouts/partials/_relearn/defaultSidebarHeader.gotmpl +++ b/layouts/partials/_relearn/defaultSidebarHeader.gotmpl @@ -33,7 +33,7 @@ {{- $defaultconfigelements = $defaultconfigelements | append (dict "type" "versionswitcher") }} {{- $defaultmenuconfigs = $defaultmenuconfigs | append - (dict "type" "custom" "identifier" "controls" "disableTitle" true "elements" $defaultconfigelements) + (dict "type" "custom" "identifier" "headercontrols" "elements" $defaultconfigelements) }} {{- $defaultmenuconfigs = $defaultmenuconfigs | append (dict "type" "divider") }} diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt index 8551edd302..1e00adcdd1 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.6.0+4e48cbf22278352557c206b228e98fc9de9d9f88 \ No newline at end of file +7.6.0+865033d3ec34d9303225defd6b595da98aab4f92 \ No newline at end of file