{{ if .Site.Params.activeInSection }} {{ .Scratch.Set "currentPage" (.Site.GetPage (printf `/%s` .Section)) }} {{ else }} {{ .Scratch.Set "currentPage" . }} {{ end }} {{ $currentPage := .Scratch.Get "currentPage" }} {{ $ctx := . }} {{ range .Site.Menus.main }} {{ if and (eq .Identifier "theme-switcher") $.Site.Params.enableDarkMode }} {{ if eq $.Site.Params.headerLayout "flex" }} {{ $switcher := partial "components/dark-mode.html" $ctx }} {{ with $switcher }}
  • {{ . }}
  • {{ end }} {{ end }} {{ else if eq .Identifier "lang-switcher" }} {{ if and $.Site.IsMultiLingual $.Site.Params.enableLangToggle }} {{ if eq $.Site.Params.headerLayout "flex" }} {{ $switcher := partial "components/multilingual.html" $ctx }} {{ with $switcher }}
  • {{ . }}
  • {{ end }} {{ end }} {{ end }} {{ else if eq .Identifier "search" }} {{ if and (eq $.Site.Params.headerLayout "flex") (or $.Site.Params.enableLunrSearch $.Site.Params.enableAlgoliaSearch) }} {{- $iconName := (string .Post) -}}
  • {{ partial "components/search.html" (dict "$" $ctx "iconName" $iconName) }}
  • {{ end }} {{ else }}
  • {{- $linkType := (string .Pre) -}} {{- $iconName := (string .Post) -}} {{- partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) -}} {{- with .Name -}} {{ . }} {{- end -}}
  • {{ end }} {{ end }}