2020-02-13 18:30:33 +01:00
|
|
|
{{- /* Desktop header */ -}}
|
2020-02-16 09:42:14 +01:00
|
|
|
<header class="desktop" id="header-desktop">
|
2020-02-13 18:30:33 +01:00
|
|
|
<div class="header-wrapper">
|
2020-03-10 17:50:06 +01:00
|
|
|
<div class="header-title">
|
2020-04-23 10:49:30 +02:00
|
|
|
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
|
|
|
|
{{- with .Site.Params.header.title -}}
|
|
|
|
{{- with .logo -}}
|
2022-05-13 20:28:35 +02:00
|
|
|
{{- dict "Src" . "Class" "logo" | partial "plugin/img.html" -}}
|
2020-04-23 10:49:30 +02:00
|
|
|
{{- end -}}
|
2020-04-29 09:40:57 +02:00
|
|
|
{{- with .pre -}}
|
|
|
|
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
|
|
|
{{- end -}}
|
2020-05-03 05:15:42 +02:00
|
|
|
{{- if .typeit -}}
|
2020-05-18 15:30:33 +02:00
|
|
|
{{- $id := dict "Content" .name "Scratch" $.Scratch | partial "function/id.html" -}}
|
2020-05-03 05:15:42 +02:00
|
|
|
<span id="{{ $id }}" class="typeit"></span>
|
|
|
|
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
|
|
|
|
{{- else -}}
|
2020-05-04 07:20:01 +02:00
|
|
|
{{- .name -}}
|
2020-05-03 05:15:42 +02:00
|
|
|
{{- end -}}
|
2020-04-29 09:40:57 +02:00
|
|
|
{{- with .post -}}
|
|
|
|
<span class="header-title-post">{{ . | safeHTML }}</span>
|
|
|
|
{{- end -}}
|
2020-04-23 10:49:30 +02:00
|
|
|
{{- else -}}
|
|
|
|
{{- .Site.Title -}}
|
|
|
|
{{- end -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
</a>
|
2019-02-03 12:30:44 +01:00
|
|
|
</div>
|
2020-02-13 18:30:33 +01:00
|
|
|
<div class="menu">
|
2020-04-15 09:46:50 +02:00
|
|
|
<div class="menu-inner">
|
|
|
|
{{- range .Site.Menus.main -}}
|
2020-05-04 10:43:47 +02:00
|
|
|
{{- $url := .URL | relLangURL -}}
|
2020-04-22 15:34:38 +02:00
|
|
|
{{- with .Page -}}
|
|
|
|
{{- $url = .RelPermalink -}}
|
|
|
|
{{- end -}}
|
|
|
|
<a class="menu-item{{ if $.IsMenuCurrent `main` . | or ($.HasMenuCurrent `main` .) | or (eq $.RelPermalink $url) }} active{{ end }}" href="{{ $url }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
|
2020-04-23 10:49:30 +02:00
|
|
|
{{- .Pre | safeHTML }} {{ .Name }} {{ .Post | safeHTML -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
</a>
|
|
|
|
{{- end -}}
|
2020-05-04 09:24:40 +02:00
|
|
|
{{- if .Site.Menus.main -}}
|
|
|
|
<span class="menu-item delimiter"></span>
|
|
|
|
{{- end -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- if .Site.IsMultiLingual -}}
|
|
|
|
<a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}">
|
|
|
|
{{- .Language.LanguageName -}}
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-chevron-right fa-fw" aria-hidden="true"></i>
|
2020-04-15 09:46:50 +02:00
|
|
|
<select class="language-select" id="language-select-desktop" onchange="location = this.value;">
|
2020-05-28 18:19:39 +02:00
|
|
|
{{- if eq .Kind "404" -}}
|
|
|
|
{{- /* https://github.com/dillonzq/LoveIt/issues/378 */ -}}
|
|
|
|
{{- range .Sites -}}
|
|
|
|
{{- $link := printf "%v/404.html" .LanguagePrefix -}}
|
|
|
|
<option value="{{ $link }}"{{ if eq . $.Site }} selected{{ end }}>
|
|
|
|
{{- .Language.LanguageName -}}
|
|
|
|
</option>
|
|
|
|
{{- end -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- range .AllTranslations -}}
|
|
|
|
<option value="{{ .RelPermalink }}"{{ if eq .Lang $.Lang }} selected{{ end }}>
|
|
|
|
{{- .Language.LanguageName -}}
|
|
|
|
</option>
|
2020-03-03 17:41:14 +01:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
</select>
|
|
|
|
</a>
|
|
|
|
{{- end -}}
|
|
|
|
{{- if .Site.Params.search.enable -}}
|
|
|
|
<span class="menu-item search" id="search-desktop">
|
2020-04-21 16:55:06 +02:00
|
|
|
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `searchPlaceholder`) }}" id="search-input-desktop">
|
2020-04-15 09:46:50 +02:00
|
|
|
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="{{ T `search` }}">
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-search fa-fw" aria-hidden="true"></i>
|
2020-04-15 09:46:50 +02:00
|
|
|
</a>
|
|
|
|
<a href="javascript:void(0);" class="search-button search-clear" id="search-clear-desktop" title="{{ T `clear` }}">
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-times-circle fa-fw" aria-hidden="true"></i>
|
2020-04-15 09:46:50 +02:00
|
|
|
</a>
|
|
|
|
<span class="search-button search-loading" id="search-loading-desktop">
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-spinner fa-fw fa-spin" aria-hidden="true"></i>
|
2020-04-15 09:46:50 +02:00
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
{{- end -}}
|
|
|
|
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
|
2020-03-08 14:02:21 +01:00
|
|
|
</a>
|
2020-04-15 09:46:50 +02:00
|
|
|
</div>
|
2019-02-03 12:30:44 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-13 18:30:33 +01:00
|
|
|
</header>
|
2020-01-30 06:17:42 +01:00
|
|
|
|
2020-02-13 18:30:33 +01:00
|
|
|
{{- /* Mobile header */ -}}
|
2020-02-16 09:42:14 +01:00
|
|
|
<header class="mobile" id="header-mobile">
|
2020-04-15 09:46:50 +02:00
|
|
|
<div class="header-container">
|
|
|
|
<div class="header-wrapper">
|
2020-03-10 17:50:06 +01:00
|
|
|
<div class="header-title">
|
2020-04-23 10:49:30 +02:00
|
|
|
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
|
|
|
|
{{- with .Site.Params.header.title -}}
|
|
|
|
{{- with .logo -}}
|
2022-05-13 20:28:35 +02:00
|
|
|
{{- dict "Src" . "Class" "logo" | partial "plugin/img.html" -}}
|
2020-04-23 10:49:30 +02:00
|
|
|
{{- end -}}
|
2020-04-29 09:40:57 +02:00
|
|
|
{{- with .pre -}}
|
|
|
|
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
|
|
|
{{- end -}}
|
2020-05-03 05:15:42 +02:00
|
|
|
{{- if .typeit -}}
|
2020-05-18 15:30:33 +02:00
|
|
|
{{- $id := dict "Content" .name "Scratch" $.Scratch | partial "function/id.html" -}}
|
2020-05-03 05:15:42 +02:00
|
|
|
<span id="{{ $id }}" class="typeit"></span>
|
|
|
|
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
|
|
|
|
{{- else -}}
|
2020-05-04 07:20:01 +02:00
|
|
|
{{- .name -}}
|
2020-05-03 05:15:42 +02:00
|
|
|
{{- end -}}
|
2020-04-29 09:40:57 +02:00
|
|
|
{{- with .post -}}
|
|
|
|
<span class="header-title-post">{{ . | safeHTML }}</span>
|
|
|
|
{{- end -}}
|
2020-04-23 10:49:30 +02:00
|
|
|
{{- else -}}
|
|
|
|
{{- .Site.Title -}}
|
|
|
|
{{- end -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
</a>
|
2019-11-23 09:22:42 +01:00
|
|
|
</div>
|
2020-02-21 04:11:56 +01:00
|
|
|
<div class="menu-toggle" id="menu-toggle-mobile">
|
2019-02-03 12:30:44 +01:00
|
|
|
<span></span><span></span><span></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-13 18:30:33 +01:00
|
|
|
<div class="menu" id="menu-mobile">
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- if .Site.Params.search.enable -}}
|
|
|
|
<div class="search-wrapper">
|
|
|
|
<div class="search mobile" id="search-mobile">
|
2020-04-21 16:55:06 +02:00
|
|
|
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `searchPlaceholder`) }}" id="search-input-mobile">
|
2020-04-15 09:46:50 +02:00
|
|
|
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="{{ T `search` }}">
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-search fa-fw" aria-hidden="true"></i>
|
2020-04-15 09:46:50 +02:00
|
|
|
</a>
|
|
|
|
<a href="javascript:void(0);" class="search-button search-clear" id="search-clear-mobile" title="{{ T `clear` }}">
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-times-circle fa-fw" aria-hidden="true"></i>
|
2020-04-15 09:46:50 +02:00
|
|
|
</a>
|
|
|
|
<span class="search-button search-loading" id="search-loading-mobile">
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-spinner fa-fw fa-spin" aria-hidden="true"></i>
|
2020-04-15 09:46:50 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<a href="javascript:void(0);" class="search-cancel" id="search-cancel-mobile">
|
|
|
|
{{ T `cancel` }}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{{- end -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- $currentPage := . -}}
|
|
|
|
{{- range .Site.Menus.main -}}
|
2020-05-04 10:43:47 +02:00
|
|
|
{{- $url := .URL | relLangURL -}}
|
2020-04-22 15:34:38 +02:00
|
|
|
{{- with .Page -}}
|
|
|
|
{{- $url = .RelPermalink -}}
|
|
|
|
{{- end -}}
|
|
|
|
<a class="menu-item" href="{{ $url }}" title="{{ .Title }}"{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
|
2020-04-23 10:49:30 +02:00
|
|
|
{{- .Pre | safeHTML }}{{ .Name }}{{ .Post | safeHTML -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
</a>
|
|
|
|
{{- end -}}
|
2020-03-14 07:42:12 +01:00
|
|
|
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
|
2020-03-14 07:42:12 +01:00
|
|
|
</a>
|
2020-03-03 17:41:14 +01:00
|
|
|
{{- if .Site.IsMultiLingual -}}
|
2020-03-09 15:19:14 +01:00
|
|
|
<a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
|
2020-03-14 07:42:12 +01:00
|
|
|
{{- .Language.LanguageName -}}
|
2022-05-06 19:54:31 +02:00
|
|
|
<i class="fas fa-chevron-right fa-fw" aria-hidden="true"></i>
|
2020-03-10 08:31:32 +01:00
|
|
|
<select class="language-select" onchange="location = this.value;">
|
2020-05-28 18:19:39 +02:00
|
|
|
{{- if eq .Kind "404" -}}
|
|
|
|
{{- /* https://github.com/dillonzq/LoveIt/issues/378 */ -}}
|
|
|
|
{{- range .Sites -}}
|
|
|
|
{{- $link := printf "%v/404.html" .LanguagePrefix -}}
|
|
|
|
<option value="{{ $link }}"{{ if eq . $.Site }} selected{{ end }}>
|
|
|
|
{{- .Language.LanguageName -}}
|
|
|
|
</option>
|
|
|
|
{{- end -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- range .AllTranslations -}}
|
|
|
|
<option value="{{ .RelPermalink }}"{{ if eq .Lang $.Lang }} selected{{ end }}>
|
|
|
|
{{- .Language.LanguageName -}}
|
|
|
|
</option>
|
2020-03-03 17:41:14 +01:00
|
|
|
{{- end -}}
|
2020-03-10 08:31:32 +01:00
|
|
|
{{- end -}}
|
|
|
|
</select>
|
2020-03-08 14:02:21 +01:00
|
|
|
</a>
|
2020-03-03 17:41:14 +01:00
|
|
|
{{- end -}}
|
2019-02-03 12:30:44 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-13 18:30:33 +01:00
|
|
|
</header>
|
2022-05-03 10:22:17 +02:00
|
|
|
|
2020-06-21 10:23:28 +02:00
|
|
|
{{- if .Site.Params.search.enable -}}
|
2022-05-03 10:22:17 +02:00
|
|
|
<div class="search-dropdown desktop">
|
|
|
|
<div id="search-dropdown-desktop"></div>
|
|
|
|
</div>
|
|
|
|
<div class="search-dropdown mobile">
|
|
|
|
<div id="search-dropdown-mobile"></div>
|
|
|
|
</div>
|
2020-06-21 10:23:28 +02:00
|
|
|
{{- end -}}
|