squirrel/layouts/partials/header.html

44 lines
2 KiB
HTML
Raw Permalink Normal View History

2021-02-25 21:23:58 +00:00
{{- $header := .Site.Params.header }}
{{- $links := index $header "links" }}
2022-06-27 14:09:44 +00:00
{{ $template := resources.Get "scss/header.scss" }}
{{ if $template }}
{{ $index := $template | resources.ExecuteAsTemplate "css/header.scss" . | resources.ToCSS (dict "outputStyle" "compressed") | fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $index.RelPermalink }}">
{{ end }}
2021-02-25 21:23:58 +00:00
{{ $template := resources.Get "scss/progressbar.scss" }}
{{ if $template }}
{{ $progressbar := $template | resources.ExecuteAsTemplate "css/progressbar.scss" . | resources.ToCSS (dict "outputStyle" "compressed") | fingerprint }}
2022-06-27 14:09:44 +00:00
<link rel="stylesheet" type="text/css" href="{{ $progressbar.RelPermalink }}">
2021-02-25 21:23:58 +00:00
{{ end }}
<div class="progress"></div>
<header class="header" id="header">
<div class="header-container">
2022-07-08 15:35:15 +00:00
<a class="home" href="/#"><img id="logo" class="logo" src="{{ .Site.Params.logo }}" alt="Logo"></a>
2021-02-25 21:23:58 +00:00
<div class="header-items" id="header-items">
{{- range $links}}
{{ if .links }}
<div class="header-item dropdown">
<button class="dropbtn">{{ .text }}
<i class="icon-caret-down"></i>
</button>
<div class="dropdown-content">
{{- range .links}}
<a href="{{ .url }}">{{ .text }}</a>
{{- end }}
</div>
</div>
{{ else }}
<a class="header-item" href="{{ .url }}">{{ .text }}</a>
{{ end }}
2021-02-25 21:23:58 +00:00
{{- end }}
2022-06-27 14:09:44 +00:00
{{ if $header.button }}
{{- range $header.button }}
{{ partial "components/button.html" . }}
{{- end }}
2022-06-27 14:09:44 +00:00
{{ end }}
2021-02-25 21:23:58 +00:00
</div>
</div>
<a href="javascript:void(0);" id="menu-icon" class="menu-icon" onclick="unfoldHeader()">&#9776;</a>
</header>
<script src="/js/header.js"></script>
<script src="/js/progress.js"></script>