mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-03-20 16:15:09 +00:00
27 lines
No EOL
1.2 KiB
Go Template
27 lines
No EOL
1.2 KiB
Go Template
{{- $defaultmenuconfigs := slice }}
|
|
{{- $defaultconfigelements := slice }}
|
|
|
|
{{- $siteLanguages := site.Languages }}
|
|
{{- $showlangswitch := and hugo.IsMultilingual (not site.Params.disableLanguageSwitchingButton) (gt (int (len $siteLanguages)) 1) }}
|
|
{{- if $showlangswitch }}
|
|
{{- $defaultconfigelements = $defaultconfigelements | append (dict "type" "languageswitcher") }}
|
|
{{- end }}
|
|
|
|
{{- $themevariants := partialCached "_relearn/themeVariants.gotmpl" . }}
|
|
{{- $showvariantswitch := gt (int (len $themevariants)) 1 }}
|
|
{{- if $showvariantswitch }}
|
|
{{- $defaultconfigelements = $defaultconfigelements | append (dict "type" "variantswitcher") }}
|
|
{{- end }}
|
|
|
|
{{- $showvisitedlinks := site.Params.showVisitedLinks }}
|
|
{{- if $showvisitedlinks }}
|
|
{{- $defaultconfigelements = $defaultconfigelements | append (dict "type" "historyclearer") }}
|
|
{{- end }}
|
|
|
|
{{- if $defaultconfigelements }}
|
|
{{- $defaultmenuconfigs = $defaultmenuconfigs | append (dict "type" "divider") }}
|
|
{{- $defaultmenuconfigs = $defaultmenuconfigs | append
|
|
(dict "type" "custom" "identifier" "controls" "disableTitle" true "elements" $defaultconfigelements)
|
|
}}
|
|
{{- end }}
|
|
{{- return $defaultmenuconfigs }} |