LoveIt/layouts/partials/header.html

49 lines
2 KiB
HTML

{{- /* Desktop header */ -}}
<header class="desktop" id="header-desktop">
<div class="header-wrapper">
<div class="header-title animated bounceIn">
<a href="{{ .Site.BaseURL }}">
{{- .Site.Title -}}
</a>
</div>
<div class="menu">
{{- $currentPage := . }}
{{- range .Site.Menus.main -}}
<a class="menu-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) | or (eq $currentPage.RelPermalink .URL) }} active{{ end }}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">
{{- .Pre | safeHTML }}{{ .Name -}}
</a>
{{- end -}}
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="{{ T "switchTheme" }}"></i></a>
</div>
</div>
</header>
{{- /* Mobile header */ -}}
<header class="mobile" id="header-mobile">
<div class="header-wrapper">
<div class="header-container">
<div class="header-title animated bounceIn">
<a href="{{ .Site.BaseURL }}">
{{- .Site.Title -}}
</a>
</div>
<div class="menu-toggle" id="menu-toggle">
<span></span><span></span><span></span>
</div>
</div>
<div class="menu" id="menu-mobile">
{{- $currentPage := . -}}
{{- range .Site.Menus.main -}}
<a class="menu-item" href="{{ .URL | absLangURL }}" title="{{ .Title }}">
{{- .Name | safeHTML -}}
</a>
{{- end -}}
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="{{ T "switchTheme" }}"></i></a>
</div>
</div>
</header>
<script>
window.desktopHeaderMode = {{ .Site.Params.header.desktopMode }};
window.mobileHeaderMode = {{ .Site.Params.header.mobileMode }};
</script>