{{/* variables for enabling/disabling various features */}} {{ $blogEnabled := site.Params.features.blog.enable | default false }} {{ $blogTitle := site.Params.features.blog.title | default (i18n "posts") }} {{ $notesEnabled := site.Params.features.notes.enable | default false }} {{ $notesTitle := site.Params.features.notes.title | default (i18n "notes") }} {{ $maxVisibleSections := site.Params.topNavbar.maxVisibleSections | default 5 }} {{/* keep backward compatibility for blog post */}} {{ if site.Params.enableBlogPost }} {{ $blogEnabled = true }} {{ end }} {{/* by default, don't use any logo */}} {{ $mainLogo := "" }} {{ $invertedLogo := "" }} {{ $darkLogo := "" }} {{/* if custom logo has been provided, use them */}} {{ if site.Params.logo.main }} {{ $mainLogo = site.Params.logo.main }} {{ end }} {{ if site.Params.logo.inverted }} {{ $invertedLogo = site.Params.logo.inverted }} {{ end }} {{ if site.Params.logo.dark }} {{ $darkLogo = site.Params.logo.dark }} {{ end }} {{/* resize the logos. don't resize svg because it is not supported */}} {{ if $mainLogo }} {{ $mainLogo = resources.Get $mainLogo}} {{ if and $mainLogo (not (or (eq $mainLogo.MediaType.SubType "svg") (eq $mainLogo.MediaType.SubType "gif"))) }} {{ $mainLogo = $mainLogo.Resize "42x" }} {{ end }} {{ $mainLogo = $mainLogo.RelPermalink}} {{ end }} {{ if $invertedLogo }} {{ $invertedLogo = resources.Get $invertedLogo}} {{ if and $invertedLogo (not (or (eq $invertedLogo.MediaType.SubType "svg") (eq $invertedLogo.MediaType.SubType "gif"))) }} {{ $invertedLogo = $invertedLogo.Resize "42x" }} {{ end }} {{ $invertedLogo = $invertedLogo.RelPermalink}} {{ end }} {{ if $darkLogo }} {{ $darkLogo = resources.Get $darkLogo}} {{ if and $darkLogo (not (or (eq $darkLogo.MediaType.SubType "svg") (eq $darkLogo.MediaType.SubType "gif"))) }} {{ $darkLogo = $darkLogo.Resize "42x" }} {{ end }} {{ $darkLogo = $darkLogo.RelPermalink}} {{ end }} {{ $logo := $mainLogo }} {{ if .IsHome }} {{ $logo = $invertedLogo }} {{ end }} {{ $customMenus := site.Params.customMenus }} {{ if (index site.Data site.Language.Lang).site.customMenus }} {{ $customMenus = (index site.Data site.Language.Lang).site.customMenus }} {{ end }} {{ $sections := site.Data.sections }} {{ if (index site.Data site.Language.Lang).sections }} {{ $sections = (index site.Data site.Language.Lang).sections }} {{ end }} {{ $navBarTitle := (index site.Data site.Language.Lang).site.navBarTitle }} {{ if not $navBarTitle }} {{ $navBarTitle = site.Title }} {{ end }}