menu: make header area configurable

This commit is contained in:
Sören Weber 2025-03-15 00:01:14 +01:00
parent 9a020e7ead
commit 6e9f056fd7
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
41 changed files with 261 additions and 70 deletions

View file

@ -1,4 +1,5 @@
assets/css/chroma*.css
assets/css/theme-neon.css
assets/css/variables.css
assets/css/*/**
assets/fonts/*/**

View file

@ -209,7 +209,10 @@ body #R-sidebar li.active > :is(a, span) {
0 0 8px var(--INTERNAL-MENU-SECTION-ACTIVE-CATEGORY-color);
}
body #R-homelinks.homelinks a:hover {
body #R-homelinks select:hover,
body #R-homelinks :is(.collapsible-menu, :not(.collapsible-menu)) li:not(.active) > label:hover,
body #R-homelinks .menu-control:hover,
body #R-homelinks :is(.collapsible-menu, :not(.collapsible-menu)) a:hover {
color: rgba(255, 255, 255, 1);
text-shadow:
0 0 1px rgba(255, 255, 255, 1),
@ -219,17 +222,31 @@ body #R-homelinks.homelinks a:hover {
0 0 8px var(--INTERNAL-MENU-HOME-LINK-HOVER-color);
}
body #R-homelinks li.active > label,
body #R-homelinks li.active > :is(a, span) {
color: var(--INTERNAL-MENU-HOME-LINK-color);
text-shadow: none;
}
body .badge,
body .btn,
body .box:not(.cstyle.transparent) {
box-shadow: 0 0 1px rgba(255, 255, 255, 1), 0 0 2px rgba(255, 255, 255, 1), 0 0 4px rgba(128, 128, 128, 1), 0 0 4px var(--VARIABLE-BOX-color);
box-shadow:
0 0 1px rgba(255, 255, 255, 1),
0 0 2px rgba(255, 255, 255, 1),
0 0 4px rgba(128, 128, 128, 1),
0 0 4px var(--VARIABLE-BOX-color);
}
body .badge > .badge-content,
body .btn,
body .btn > *,
body .box:not(.cstyle.transparent) > .box-label {
text-shadow: 0 0 1px rgba(255, 255, 255, 1), 0 0 2px rgba(255, 255, 255, 1), 0 0 4px rgba(128, 128, 128, 1), 0 0 4px var(--VARIABLE-BOX-CAPTION-color);
text-shadow:
0 0 1px rgba(255, 255, 255, 1),
0 0 2px rgba(255, 255, 255, 1),
0 0 4px rgba(128, 128, 128, 1),
0 0 4px var(--VARIABLE-BOX-CAPTION-color);
}
body .tab-panel-cstyle:not(.transparent),

View file

@ -1494,28 +1494,6 @@ div.highlight:hover .block-copy-to-clipboard-button {
padding-right: 5px;
}
#R-homelinks {
background-color: var(--INTERNAL-MENU-HEADER-BORDER-color);
padding: 0;
}
#R-homelinks.homelinks a {
color: var(--INTERNAL-MENU-HOME-LINK-color);
}
#R-homelinks.homelinks a:hover {
color: var(--INTERNAL-MENU-HOME-LINK-HOVER-color);
}
#R-homelinks ul {
margin: 0.5rem 0;
}
#R-homelinks hr {
border-color: var(--INTERNAL-MENU-HEADER-SEPARATOR-color);
border-bottom-style: solid;
border-bottom-width: 1px;
margin: 0 1rem 3px 1rem;
}
option {
color: initial;
}
@ -2409,6 +2387,54 @@ html[dir='rtl'] #R-sidebar ul.collapsible-menu > li > input:checked + label > i.
transform: rotate(90deg);
}
/* basic menu header styles */
#R-homelinks {
background-color: var(--INTERNAL-MENU-HEADER-BORDER-color);
padding: 0;
}
#R-homelinks ul {
margin: 0.5rem 0;
}
#R-homelinks hr {
border-color: var(--INTERNAL-MENU-HEADER-SEPARATOR-color);
border-bottom-style: solid;
border-bottom-width: 1px;
margin: 0 1rem 3px 1rem;
}
#R-homelinks .nav-title {
color: var(--INTERNAL-MENU-HOME-LINK-color);
}
/* override for the menu header */
#R-homelinks select,
#R-homelinks .collapsible-menu label,
#R-homelinks .menu-control,
#R-homelinks :is(a, span) {
color: var(--INTERNAL-MENU-HOME-LINK-color);
}
#R-homelinks select:hover,
#R-homelinks :is(.collapsible-menu, :not(.collapsible-menu)) li:not(.active) > label:hover,
#R-homelinks .menu-control:hover,
#R-homelinks :is(.collapsible-menu, :not(.collapsible-menu)) a:hover {
color: var(--INTERNAL-MENU-HOME-LINK-HOVER-color);
}
#R-homelinks li.active > label,
#R-homelinks li.active > a {
color: var(--INTERNAL-MENU-HOME-LINK-color);
}
#R-homelinks li.active > a {
background-color: transparent;
}
/* basic logo stuff
a#R-logo {
color: var(--INTERNAL-MENU-HEADER-color);
font-variation-settings: var(--INTERNAL-MAIN-TITLES-H4-font-variation-settings);

View file

@ -290,11 +290,8 @@ collapsibleMenu = true
disableShortcutsTitle = false
# Define your own sidebar menus.
# Default: the value used below
# The sidebar menus are built from this parameter. If not set, it contains
# the below default.
# Menus are written from the sidebar's top to buttom in the order given in
# this array.
# these arrays.
# This can be overridden in the page's frontmatter.
# Each entry can contain the following keys:
# - `type` is mandatory. Either `page` in case it should generate a tre from
@ -315,6 +312,18 @@ disableShortcutsTitle = false
# from the menu `name` and if this is not set form the page's `linkTitle`.
# - `pageRef`, optional. In case of `type=page` this is the starting page's
# path. If not set, the home page will be used.
# Define your own menus of the sidebar header.
# Default: see notes
# If not given, this accounts to the settings for disableLandingPageButton
# and landingPageName. Otherwise you are free to define any menus as explained
# above
sidebarheadermenus = ""
# Default: the value used below, but see the notes
# The sidebar menus are built from this parameter. If not set, it contains
# the below default. The default for the shortcut's disableTitle accounts
# to the setting of disableShortcutsTitle.
sidebarmenus = [
{ type = 'page', identifier = 'home', main = true, disableTitle = true, pageRef = '' },
{ type = 'menu', identifier = 'shortcuts', main = false, disableTitle = false },

View file

@ -163,11 +163,8 @@ alwaysopen = ''
collapsibleMenu = true
# Define your own sidebar menus.
# Default: the value used below
# The sidebar menus are built from this parameter. If not set, the set value
# of your site's hugo.toml is used and contains the below default.
# Menus are written from the sidebar's top to buttom in the order given in
# this array.
# these arrays. If not set, the set value of your site's hugo.toml is used.
# Each entry can contain the following keys:
# - `type` is mandatory. Either `page` in case it should generate a tre from
# the page structure or `menu` in case it should generate a tree from a
@ -187,6 +184,18 @@ collapsibleMenu = true
# from the menu `name` and if this is not set form the page's `linkTitle`.
# - `pageRef`, optional. In case of `type=page` this is the starting page's
# path. If not set, the home page will be used.
# Define your own menus of the sidebar header.
# Default: see notes
# If not given, this accounts to the settings for disableLandingPageButton
# and landingPageName. Otherwise you are free to define any menus as explained
# above
sidebarheadermenus = ""
# Default: the value used below, but see the notes
# The sidebar menus are built from this parameter. If not set, it contains
# the below default. The default for the shortcut's disableTitle accounts
# to the setting of disableShortcutsTitle.
sidebarmenus = [
{ type = 'page', identifier = 'home', main = true, disableTitle = true, pageRef = '' },
{ type = 'menu', identifier = 'shortcuts', main = false, disableTitle = false },

View file

@ -48,6 +48,8 @@ If this option isn't set for a specific language, it will use these default valu
landingPageName = '<i class="fa-fw fas fa-home"></i> Home'
{{< /multiconfig >}}
For a free configuration of the header menus, see [configuration of the sidebar menus](/configuration/sidebar/menus#defining-sidebar-menus).
## History
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} Turn on `showVisitedLinks=true` to see checkmarks next to visited pages in the main menu. This also adds a `Clear History` option at the bottom of the menu to remove all checkmarks. Note that checkmarks will disappear if you rebuild your site, as the page IDs may change.

View file

@ -1,8 +1,8 @@
+++
categories = ["howto"]
description = "Configure all things menus"
frontmatter = ["alwaysopen", "collapsibleMenu", "linkTitle", "menuPageRef", "menuPost", "menuPre", "menuUrl", "ordersectionsby", "sidebarmenus"]
options = ["alwaysopen", "collapsibleMenu", "disableShortcutsTitle", "ordersectionsby", "sidebarmenus"]
frontmatter = ["alwaysopen", "collapsibleMenu", "linkTitle", "menuPageRef", "menuPost", "menuPre", "menuUrl", "ordersectionsby", "sidebarheadermenus", "sidebarmenus"]
options = ["alwaysopen", "collapsibleMenu", "disableShortcutsTitle", "ordersectionsby", "sidebarheadermenus", "sidebarmenus"]
title = "Menus"
weight = 4
+++
@ -166,16 +166,17 @@ If you want to learn how to configure different Hugo menus for each language, [s
{{< multiconfig fm=true >}}
[[menu.addendum]]
identifier = 'addendum-top'
name = 'A Menu Title for the Whole Menu'
[[menu.addendum]]
parent = 'Parent'
parent = 'addendum-top'
name = 'A Menu Entry Title for Child 1'
url = 'https://example.com/1'
weight = 1
[[menu.addendum]]
parent = 'Parent'
parent = 'addendum-top'
name = 'A Menu Entry Title for Child 2'
url = 'https://example.com/2'
weight = 2
@ -201,9 +202,16 @@ other = "Other Great Stuff"
## Defining Sidebar Menus
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} {{% badge style="green" icon="fa-fw fab fa-markdown" title=" " %}}Front Matter{{% /badge %}} Menus are defined using the `sidebarmenus` option.
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} {{% badge style="green" icon="fa-fw fab fa-markdown" title=" " %}}Front Matter{{% /badge %}} Menus are defined using the `sidebarheadermenus` or `sidebarmenus` option.
You can define as many menus, as you like. If you don't overwrite this option, the theme defaults to
As these options are arrays, you can define as many menus, as you like.
- `sidebarheadermenus`: the non-scrolling area below the search box
- `sidebarmenus`: the scrolling area below the search box
If you don't overwrite this option, for `sidebarheadermenus` the theme accounts to your settings of `disableLandingPageButton` and `landingPageName`. See [configuration for the landing page](/configuration/sidebar/headerfooter#home-button-configuration) for further information.
If you don't overwrite this option, for `sidebarmenus` the theme defaults to
{{< multiconfig >}}
sidebarmenus = [
@ -212,6 +220,8 @@ sidebarmenus = [
]
{{< /multiconfig >}}
The default value for the shortcut's `disableTitle` accounts to the setting of `disableShortcutsTitle`.
### Parameter
| Name | Default | Notes |

View file

@ -1,8 +1,8 @@
+++
categories = ["howto"]
description = "Configure all things menus"
frontmatter = ["alwaysopen", "collapsibleMenu", "linkTitle", "menuPost", "menuPre", "ordersectionsby", "sidebarmenus"]
options = ["alwaysopen", "collapsibleMenu", "disableShortcutsTitle", "ordersectionsby", "sidebarmenus"]
frontmatter = ["alwaysopen", "collapsibleMenu", "linkTitle", "menuPost", "menuPre", "ordersectionsby", "sidebarheadermenus", "sidebarmenus"]
options = ["alwaysopen", "collapsibleMenu", "disableShortcutsTitle", "ordersectionsby", "sidebarheadermenus", "sidebarmenus"]
title = "Menus"
weight = 4
+++

View file

@ -10,4 +10,10 @@ weight = -6
### New
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The free menu configuration for the main menu area, [introduced in 7.1.0](introduction/releasenotes/7/1), is extended to the non-scolling menu header area between search box and main scrolling area using the `sidebarheadermenus` option.
The [configuration for all sidebar menus](/configuration/sidebar/menus#defining-sidebar-menus) is similar.
You dont need to change anything in your existing installation as the old configuration is used as a default.
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Translation into Ukrainian. This language is not supported for search.

View file

@ -37,6 +37,9 @@ other = "Whoops. Looks like this plank doesn't exist ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Go t' homeplank"
[home-button]
other = "Home"
[Edit-this-page]
other = "Edit"

View file

@ -37,6 +37,9 @@ other = "Whoops. Looks like this plank doesn't exist ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Go t' homeplank"
[home-button]
other = "Home"
[Edit-this-page]
other = "Edit"

View file

@ -37,6 +37,9 @@ other = ".¯\\_(ツ)_/¯أوبس. يبدو أن هذه الصفحة غير مو
[Go-to-homepage]
other = "الذهاب إلى الصفحة الرئيسية"
[home-button]
other = "Home"
[Edit-this-page]
other = "حرر"

View file

@ -37,6 +37,9 @@ other = "Ups. Zdá se, že tato stránka neexistuje ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Přejít na domovskou stránku"
[home-button]
other = "Home"
[Edit-this-page]
other = "Upravit"

View file

@ -37,6 +37,9 @@ other = "Huch. Diese Seite scheint nicht zu existieren ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Gehe zur Homepage"
[home-button]
other = "Home"
[Edit-this-page]
other = "Bearbeiten"

View file

@ -37,6 +37,9 @@ other = "Whoops. Looks like this page doesn't exist ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Go to homepage"
[home-button]
other = "Home"
[Edit-this-page]
other = "Edit"

View file

@ -37,6 +37,9 @@ other = "Ups. Parece que la página no existe ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Ir al inicio"
[home-button]
other = "Home"
[Edit-this-page]
other = "Editar"

View file

@ -37,6 +37,9 @@ other = "اوه! به نظر می‌رسد این صفحه وجود ندارد
[Go-to-homepage]
other = "رفتن به صفحه اصلی"
[home-button]
other = "Home"
[Edit-this-page]
other = "ویرایش"

View file

@ -37,6 +37,9 @@ other = "Sivua ei ole ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Etusivulle"
[home-button]
other = "Home"
[Edit-this-page]
other = "Muokkaa"

View file

@ -37,6 +37,9 @@ other = "Oups. On dirait que cette page n'existe pas ¯\\_(ツ)_/¯"
[Go-to-homepage]
other = "Vers la page d'accueil"
[home-button]
other = "Home"
[Edit-this-page]
other = "Éditer"

View file

@ -37,6 +37,9 @@ other = "यह पृष्ठ अभि अनुपलब्ध है!"
[Go-to-homepage]
other = "मुख्य पृष्ठ पर जाऐ"
[home-button]
other = "Home"
[Edit-this-page]
other = "संपादन करना"

View file

@ -37,6 +37,9 @@ other = "Hoppá. Úgy tűnik, hogy ez az oldal nem létezik ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Menj a kezdőlapra"
[home-button]
other = "Home"
[Edit-this-page]
other = "Szerkesztés"

View file

@ -37,6 +37,9 @@ other = "Oops. Sepertinya halaman ini tidak ada ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Ke halaman depan"
[home-button]
other = "Home"
[Edit-this-page]
other = "Mengedit"

View file

@ -37,6 +37,9 @@ other = "Oh no! Sembra che la pagina da te cercata non esista ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Ritorna alla pagina iniziale"
[home-button]
other = "Home"
[Edit-this-page]
other = "Modifica"

View file

@ -37,6 +37,9 @@ other = "おっと。ページが見当たりません。 ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "ホームページへ行く"
[home-button]
other = "Home"
[Edit-this-page]
other = "編集"

View file

@ -37,6 +37,9 @@ other = "존재하지 않는 페이지입니다."
[Go-to-homepage]
other = "메인화면"
[home-button]
other = "Home"
[Edit-this-page]
other = "편집"

View file

@ -37,6 +37,9 @@ other = "Blijkbaar bestaat deze pagina niet ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Naar startpagina"
[home-button]
other = "Home"
[Edit-this-page]
other = "Bewerken"

View file

@ -37,6 +37,9 @@ other = "Ups. Wygląda na to, że strona nie istnieje ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Idź do strony paczątkowej"
[home-button]
other = "Home"
[Edit-this-page]
other = "Edycja"

View file

@ -37,6 +37,9 @@ other = "Ops. Parece que a página não existe ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Ir para o início"
[home-button]
other = "Home"
[Edit-this-page]
other = "Editar"

View file

@ -37,6 +37,9 @@ other = "Ups. Se pare că această pagină nu există ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Mergi la pagina principală"
[home-button]
other = "Home"
[Edit-this-page]
other = "Editează"

View file

@ -37,6 +37,9 @@ other = "Упс. Выглядит будто такой страницы нет
[Go-to-homepage]
other = "Перейти на главную"
[home-button]
other = "Home"
[Edit-this-page]
other = "редактировать"

View file

@ -37,6 +37,9 @@ other = "Lo! Inaonekana ukurasa huu haupo ¯\\_(ツ)_/¯."
[Go-to-homepage]
other = "Nenda kwenye ukurasa wa kwanza"
[home-button]
other = "Home"
[Edit-this-page]
other = "Hariri"

View file

@ -37,6 +37,9 @@ other = "Uups. Görünüşe göre böyle bir sayfa yok ¯\\_(ツ)_/¯"
[Go-to-homepage]
other = "Anasayfaya dön"
[home-button]
other = "Home"
[Edit-this-page]
other = "Düzenlemek"

View file

@ -37,6 +37,9 @@ other = "Ой! Щось пішло не так. Схоже що цю сторі
[Go-to-homepage]
other = "Повернутися до початкової сторінки"
[home-button]
other = "Home"
[Edit-this-page]
other = "Редагувати"

View file

@ -37,6 +37,9 @@ other = "Tiếc quá! Có vẻ như trang này không tồn tại ¯\\_(ツ)_/¯
[Go-to-homepage]
other = "Đi đến trang chủ"
[home-button]
other = "Home"
[Edit-this-page]
other = "Biên tập"

View file

@ -37,6 +37,9 @@ other = "哎哟。 看起来这个页面不存在 ¯\\_(ツ)_/¯。"
[Go-to-homepage]
other = "转到主页"
[home-button]
other = "Home"
[Edit-this-page]
other = "编辑"

View file

@ -37,6 +37,9 @@ other = "哎哟。 看起来这个页面不存在 ¯\\_(ツ)_/¯。"
[Go-to-homepage]
other = "转到主页"
[home-button]
other = "Home"
[Edit-this-page]
other = "编辑"

View file

@ -37,6 +37,9 @@ other = "這個網頁已經被刪除、移動或從未存在"
[Go-to-homepage]
other = "回到首頁"
[home-button]
other = "Home"
[Edit-this-page]
other = "編輯網頁"

View file

@ -37,6 +37,9 @@ other = "這個網頁已經被刪除、移動或從未存在"
[Go-to-homepage]
other = "回到首頁"
[home-button]
other = "Home"
[Edit-this-page]
other = "編輯網頁"

View file

@ -37,6 +37,9 @@ other = "哎哟。 看起来这个页面不存在 ¯\\_(ツ)_/¯。"
[Go-to-homepage]
other = "转到主页"
[home-button]
other = "Home"
[Edit-this-page]
other = "编辑"

View file

@ -33,31 +33,40 @@
{{- end }}
</div>
<div id="R-homelinks" class="default-animation{{ if not .Site.Params.disableLandingPageButton }} homelinks{{ end }}">
{{- if not .Site.Params.disableLandingPageButton }}
{{- if (ne .Site.Params.landingPageURL nil) }}
{{- warnf "UNSUPPORTED usage of 'landingPageURL' config parameter found, remove it and optionally overwrite the `logo.html` partial to provide a link if it should not point to the project's home page; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/4/#4-2-0" }}
{{- $defaultmenuconfigs := slice }}
{{- if not .Site.Params.disableLandingPageButton }}
{{- if (ne .Site.Params.landingPageURL nil) }}
{{- warnf "UNSUPPORTED usage of 'landingPageURL' config parameter found, remove it and optionally overwrite the `logo.html` partial to provide a link if it should not point to the project's home page; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/4/#4-2-0" }}
{{- end }}
{{- $title := trim (.Site.Params.landingPageName | plainify) "\n\r\t "}}
{{- $pre := "" }}
{{- $post := "" }}
{{- if $title }}
{{- $escapedTitle := replaceRE `([\.+*?()|[\]{}^$\\])` "\\$1" $title }}
{{- $pre = (replaceRE (printf `%s.*` $escapedTitle) "" .Site.Params.landingPageName) | safeHTML }}
{{- $post = (replaceRE (printf `.*?%s` $escapedTitle) "" .Site.Params.landingPageName) | safeHTML }}
{{- else }}
{{- $title = T "home-button" }}
{{- $pre = `<i class="fa-fw fas fa-home"></i> ` | safeHTML }}
{{- end }}
{{- $defaultmenuconfigs = slice
(dict "type" "menu" "identifier" "R-homelinks" "disableTitle" true "entries" (slice
(dict "Menu" "" "Children" (slice
(dict "Menu" "" "Pre" $pre "Post" $post "Title" $title "PageRef" "/" )
))
))
}}
{{- end }}
<ul>
<li><a class="padding" href="{{ partial "permalink.gotmpl" (dict "to" .Site.Home) }}">{{ .Site.Params.landingPageName | default `<i class="fa-fw fas fa-home"></i> Home` | safeHTML }}</a></li>
</ul>
{{- end }}
{{- $menuconfigs := .Params.sidebarheadermenus | default site.Params.sidebarheadermenus | default $defaultmenuconfigs }}
{{- partial "partials/inline/menu" (dict "currentnode" $currentNode "configs" $menuconfigs "showvisitedlinks" false) }}
<hr class="padding">
</div>
<div id="R-content-wrapper" class="highlightable">
{{- $menuconfigs := .Params.sidebarmenus | default site.Params.sidebarmenus | default (slice
(dict "type" "page" "identifier" "home")
(dict "type" "menu" "identifier" "shortcuts")
(dict "type" "menu" "identifier" "shortcuts" "disableTitle" site.Params.disableShortcutsTitle)
) }}
{{- range $menuconfigs }}
{{- $config := . }}
{{- if eq $config.type "page" }}
{{- partial "partials/inline/page-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks) }}
{{- else if eq $config.type "menu" }}
{{- partial "partials/inline/menu-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks) }}
{{- else }}
{{- warnf "WARNING: unknown menu type '%s' found in parameter 'sidebarmenus' for menu '%s'; use either 'page' or 'menu'" $config.type $config.identifier }}
{{- end }}
{{- end }}
{{- partial "partials/inline/menu" (dict "currentnode" $currentNode "configs" $menuconfigs "showvisitedlinks" $showvisitedlinks) }}
{{- $siteLanguages := .Site.Languages }}
{{- $showlangswitch := and hugo.IsMultilingual (not .Site.Params.disableLanguageSwitchingButton) (gt (int (len $siteLanguages)) 1) }}
{{- $themevariants := partialCached "_relearn/themeVariants.gotmpl" . }}
@ -75,11 +84,11 @@
<span>&nbsp;</span>
<div class="control-style">
<label class="a11y-only" for="R-select-language">{{ T "Language" }}</label>
<select id="R-select-language" onchange="location = this.querySelector( this.value ).dataset.url;">
<select id="R-select-language" onchange="location = this.querySelector( `#R-select-language-${this.value}` ).dataset.url;">
{{- $page := .Page }}
{{- $pageLang := .Page.Language.Lang }}
{{- range .Page.AllTranslations }}
<option id="R-select-language-{{ .Language.Lang }}" value="#R-select-language-{{ .Language.Lang }}" data-url="{{ partial "permalink.gotmpl" (dict "to" .) }}" lang="{{ .Language.LanguageCode }}"{{ if eq $pageLang .Language.Lang }} selected{{ end }}>{{ .Language.LanguageName }}</option>
<option id="R-select-language-{{ .Language.Lang }}" value="{{ .Language.Lang }}" data-url="{{ partial "permalink.gotmpl" (dict "to" .) }}" lang="{{ .Language.LanguageCode }}"{{ if eq $pageLang .Language.Lang }} selected{{ end }}>{{ .Language.LanguageName }}</option>
{{- end }}
</select>
</div>
@ -124,6 +133,22 @@
</div>
</aside>
{{- define "partials/inline/menu" }}
{{- $currentNode := .currentnode }}
{{- $configs := .configs }}
{{- $showvisitedlinks := .showvisitedlinks }}
{{- range $configs }}
{{- $config := . }}
{{- if eq $config.type "page" }}
{{- partial "partials/inline/page-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks) }}
{{- else if eq $config.type "menu" }}
{{- partial "partials/inline/menu-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks "entries" ($config.entries | default (index site.Menus $config.identifier))) }}
{{- else }}
{{- warnf "WARNING: unknown menu type '%s' found in parameter 'sidebarmenus' for menu '%s'; use either 'page' or 'menu'" $config.type $config.identifier }}
{{- end }}
{{- end }}
{{- end }}
{{- define "partials/inline/page-tree" }}
{{- $currentNode := .currentnode }}
{{- $config := .config }}
@ -273,7 +298,7 @@
{{- $currentNode := .currentnode }}
{{- $config := .config }}
{{- $showvisitedlinks := .showvisitedlinks }}
{{- with index site.Menus $config.identifier }}
{{- with .entries }}
<div id="R-shortcutmenu-{{ $config.identifier }}" class="R-sidebarmenu">
{{- $topLevelMenu := "" }}
{{- $topLevelObject := "" }}
@ -293,10 +318,6 @@
{{- if not ($config.disableTitle | default false) }}
{{- if $topLevelMenu }}
{{- $title = partial "_relearn/menuTitle.gotmpl" (dict "page" $currentNode "menu" $topLevelMenu) }}
{{- else if eq $config.identifier "shortcuts" }}
{{- if not site.Params.DisableShortcutsTitle }}
{{- $title = T (print $config.identifier "-menuTitle") }}
{{- end }}
{{- else }}
{{- $title = T (print $config.identifier "-menuTitle") }}
{{- end }}
@ -314,7 +335,7 @@
{{- range $entries }}
{{- $entriesObject := partial "_relearn/menuObject.gotmpl" (dict "page" $currentNode "menu" .) }}
{{- $isSubSelf := eq $entriesObject $currentNode }}
{{- $isSubAncestor := and (not $isSubSelf) ($currentNode.HasMenuCurrent .Menu .) }}
{{- $isSubAncestor := and (not $isSubSelf) .Menu ($currentNode.HasMenuCurrent .Menu .) }}
{{- $isSubHidden := or (.Params.hidden) (eq (partial "_relearn/menuTitle.gotmpl" (dict "page" $currentNode "menu" .)) "") }}
{{- $isSubCollapsible := .Params.collapsibleMenu | default $root.Params.collapsibleMenu | default site.Params.collapsibleMenu }}
{{- if or $isSubSelf $isSubAncestor }}
@ -327,7 +348,7 @@
</ul>
</div>
{{- else }}
{{- if ne $config.identifier "shortcuts" }}
{{- if not (isset $config "entries") }}
{{- $msg := printf "config option 'identifier' for 'sidebarmenus' %q is not a menu" $config.identifier }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" $config.pageRef "page" $currentNode "param" "link" "msg" $msg "applyErrorIgnore" false) }}
{{- end }}
@ -396,7 +417,7 @@
{{- range $entries }}
{{- $entriesObject := partial "_relearn/menuObject.gotmpl" (dict "page" $currentNode "menu" .) }}
{{- $isSubSelf := eq $entriesObject $currentNode }}
{{- $isSubAncestor := and (not $isSubSelf) ($currentNode.HasMenuCurrent .Menu .) }}
{{- $isSubAncestor := and (not $isSubSelf) .Menu ($currentNode.HasMenuCurrent .Menu .) }}
{{- $isSubHidden := or (.Params.hidden) (eq (partial "_relearn/menuTitle.gotmpl" (dict "page" $currentNode "menu" .)) "") }}
{{- $isSubCollapsible := .Params.collapsibleMenu | default $root.Params.collapsibleMenu | default site.Params.collapsibleMenu }}
{{- if or $isSubSelf $isSubAncestor }}

View file

@ -1 +1 @@
7.5.0+5797d81e8e09fdde6f433378d55f780e27684f56
7.5.0+9a020e7eadb7d8203f5b01b18756c72d94773ec9