{{- $buildDrafts := .Site.BuildDrafts -}} {{- /* Desktop header */ -}} {{- with .Site.Params.header.title -}} {{- with .logo -}} {{- dict "Src" . "Class" "logo" "Alt" $.Site.Title | partial "plugin/image.html" -}} {{- end -}} {{- with .pre -}} {{ . | safeHTML }} {{- end -}} {{- if .typeit -}} {{- $id := dict "Content" .name "Scratch" $.Scratch "Id" "typeit-header-desktop" | partial "function/id.html" -}} {{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}} {{- else -}} {{- .name -}} {{- end -}} {{- with .post -}} {{ . | safeHTML }} {{- end -}} {{- else -}} {{- .Site.Title -}} {{- end -}} {{- with .Site.Params.header.subtitle -}} {{- if .typeit -}} {{- $id := dict "Content" .name "Scratch" $.Scratch "Id" "typeit-header-subtitle-desktop" | partial "function/id.html" -}} {{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}} {{- else -}} {{- .name -}} {{- end -}} {{- end -}} {{- range .Site.Menus.main -}} {{- $url := .URL | relLangURL -}} {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} {{- if (ne .Params.Draft true) | or $buildDrafts | and (ne .Params.Type "mobile") -}} {{- with .Pre -}}{{- . | safeHTML }} {{ end }} {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} {{- .Name }} {{- with .Post }} {{ . | safeHTML -}}{{- end -}} {{- if .HasChildren -}} {{ dict "Class" "dropdown-icon fa-solid fa-chevron-down" | partial "plugin/icon.html" }} {{ range .Children }} {{- $url := .URL | relLangURL -}} {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} {{- if (ne .Params.Draft true) | or $buildDrafts | and (ne .Params.Type "mobile") -}} {{- with .Pre -}}{{- . | safeHTML }} {{ end }} {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} {{- .Name }} {{- with .Post }} {{ . | safeHTML -}}{{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- if .Site.Menus.main -}} {{- end -}} {{- if .Site.Params.search.enable -}} {{ dict "Class" "fa-solid fa-search fa-fw" | partial "plugin/icon.html" }} {{ dict "Class" "fa-solid fa-times-circle fa-fw" | partial "plugin/icon.html" }} {{ dict "Class" "fa-solid fa-spinner fa-fw fa-spin" | partial "plugin/icon.html" }} {{- end -}} {{ dict "Class" "fa-solid fa-adjust fa-fw" | partial "plugin/icon.html" }} {{- if .Site.IsMultiLingual -}} {{- dict "Class" "fa-solid fa-language fa-fw" | partial "plugin/icon.html" -}} {{- if (eq .Kind "404") -}} {{- range .Sites -}} {{- if ne . $.Site -}} {{- $link := printf "%v/404.html" .LanguagePrefix -}} {{- .Language.LanguageName -}} {{- end -}} {{- end -}} {{- else if gt (len .AllTranslations) 1 -}} {{- range .AllTranslations -}} {{- if ne .Lang $.Lang -}} {{- .Language.LanguageName -}} {{- else -}} {{ .Language.LanguageName }} {{- end -}} {{- end -}} {{- else -}} {{- T "header.noMoretTranslations" -}} {{- end -}} {{- end -}} {{- /* Mobile header */ -}} {{- with .Site.Params.header.title -}} {{- with .logo -}} {{- dict "Src" . "Class" "logo" | partial "plugin/image.html" -}} {{- end -}} {{- with .pre -}} {{ . | safeHTML }} {{- end -}} {{- if .typeit -}} {{- $id := dict "Content" .name "Scratch" $.Scratch "Id" "typeit-header-title-mobile" | partial "function/id.html" -}} {{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}} {{- else -}} {{- .name -}} {{- end -}} {{- with .post -}} {{ . | safeHTML }} {{- end -}} {{- else -}} {{- .Site.Title -}} {{- end -}} {{- with .Site.Params.header.subtitle -}} {{- if .typeit -}} {{- $id := dict "Content" .name "Scratch" $.Scratch "Id" "typeit-header-subtitle-mobile" | partial "function/id.html" -}} {{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}} {{- else -}} {{- .name -}} {{- end -}} {{- end -}} {{- if .Site.Params.search.enable -}} {{ dict "Class" "fa-solid fa-search fa-fw" | partial "plugin/icon.html" }} {{ dict "Class" "fa-solid fa-times-circle fa-fw" | partial "plugin/icon.html" }} {{ dict "Class" "fa-solid fa-spinner fa-fw fa-spin" | partial "plugin/icon.html" }} {{ T `assets.cancel` }} {{- end -}} {{- $currentPage := . -}} {{- range .Site.Menus.main -}} {{- $url := .URL | relLangURL -}} {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} {{- if (ne .Params.Draft true) | or $buildDrafts | and (ne .Params.Type "desktop") -}} {{- if .HasChildren -}} {{- with .Pre -}}{{- . | safeHTML }} {{ end }} {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} {{- .Name }} {{- with .Post }} {{ . | safeHTML -}}{{- end -}} {{ dict "Class" "dropdown-icon fa-solid fa-chevron-right" | partial "plugin/icon.html" }} {{ range .Children }} {{- $url := .URL | relLangURL -}} {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} {{- if (ne .Params.Draft true) | or $buildDrafts | and (ne .Params.Type "desktop") -}} {{- with .Pre -}}{{- . | safeHTML }} {{ end }} {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} {{- .Name }} {{- with .Post }} {{ . | safeHTML -}}{{- end -}} {{- end -}} {{- end -}} {{- else -}} {{- with .Pre -}}{{- . | safeHTML }} {{ end }} {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} {{- .Name }} {{- with .Post }} {{ . | safeHTML -}}{{- end -}} {{- end -}} {{- end -}} {{- end -}} {{ dict "Class" "fa-solid fa-adjust fa-fw" | partial "plugin/icon.html" }} {{- if .Site.IsMultiLingual -}} {{- .Language.LanguageName -}} {{- dict "Class" "dropdown-icon fa-solid fa-chevron-down" | partial "plugin/icon.html" -}} {{- if eq .Kind "404" -}} {{- range .Sites -}} {{- $link := printf "%v/404.html" .LanguagePrefix -}} {{- .Language.LanguageName -}} {{- end -}} {{- else if gt (len .AllTranslations) 1 -}} {{- range .AllTranslations -}} {{- .Language.LanguageName -}} {{- end -}} {{- else -}} {{- T "header.noMoretTranslations" -}} {{- end -}} {{- end -}} {{- if .Site.Params.search.enable -}}