{{- /* Desktop header */ -}} {{- with .Site.Params.header.title -}} {{- with .logo -}} {{- dict "src" . "alt" $.Site.Title "class" "logo" | partial "plugin/image.html" -}} {{- end -}} {{- with .pre -}} {{ . | safeHTML }} {{- end -}} {{- if .typeit -}} {{- $id := dict "Content" .name "Scratch" $.Scratch | 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 -}} {{- range .Site.Menus.main -}} {{- $url := .URL | relLangURL -}} {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} {{- .Pre | safeHTML }} {{ .Name }} {{ .Post | safeHTML -}} {{- end -}} {{- if .Site.Menus.main -}} {{- end -}} {{- if .Site.IsMultiLingual -}} {{- .Language.LanguageName -}} {{- range .Page.AllTranslations -}} {{- $translation := . -}} {{- range $.Site.Languages -}} {{- if eq $translation.Lang .Lang -}} {{- if eq $.Page.Lang .Lang -}} {{ .LanguageName }} {{- else -}} {{ .LanguageName }} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- if .Site.Params.search.enable -}} {{- end -}} {{- /* Mobile header */ -}} {{- with .Site.Params.header.title -}} {{- with .logo -}} {{- dict "src" . "alt" $.Site.Title "class" "logo" | partial "plugin/image.html" -}} {{- end -}} {{- with .pre -}} {{ . | safeHTML }} {{- end -}} {{- if .typeit -}} {{- $id := dict "Content" .name "Scratch" $.Scratch | 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 -}} {{- if .Site.Params.search.enable -}} {{ T `cancel` }} {{- end -}} {{- $currentPage := . -}} {{- range .Site.Menus.main -}} {{- $url := .URL | relLangURL -}} {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} {{- .Pre | safeHTML }}{{ .Name }}{{ .Post | safeHTML -}} {{- end -}} {{- if .Site.IsMultiLingual -}} {{- .Language.LanguageName -}} {{- range .Page.AllTranslations -}} {{- $translation := . -}} {{- range $.Site.Languages -}} {{- if eq $translation.Lang .Lang -}} {{- if eq $.Page.Lang .Lang -}} {{ .LanguageName }} {{- else -}} {{ .LanguageName }} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}}