hugo-geekblog/layouts/partials/site-header.html

58 lines
2.7 KiB
HTML
Raw Permalink Normal View History

2020-07-06 18:55:32 +00:00
<header class="gblog-header">
2021-11-23 15:53:25 +00:00
<div class="container flex flex-wrap">
<div class="gblog-header__col-1 flex justify-start hidden-mobile"></div>
<div class="gblog-header__col-2 flex align-center justify-center ">
<a class="gblog-header__link" rel="me" href="{{ .Site.BaseURL }}">
<span class="gblog-brand flex align-center justify-center">
<img class="gblog-brand__img" src="{{ (default "brand.svg" .Site.Params.logo) | relURL }}" alt="">
{{ .Site.Title }}
</span>
{{ with .Site.Params.subtitle }}
<span class="gblog-brand__subtitle flex align-center justify-center">{{ . }}</span>
{{ end }}
</a>
</div>
<div class="gblog-header__col-3 flex justify-end">
<span id="gblog-dark-mode">
<svg class="icon gblog_brightness_dark">
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gblog_brightness_dark"></use>
</svg>
<svg class="icon gblog_brightness_light">
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gblog_brightness_light"></use>
</svg>
<svg class="icon gblog_brightness_auto">
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gblog_brightness_auto"></use>
</svg>
2020-07-06 18:55:32 +00:00
</span>
2021-11-23 15:53:25 +00:00
</div>
2020-07-06 18:55:32 +00:00
</div>
</header>
<nav class="gblog-nav">
<input type="checkbox" id="menu-control" class="hidden">
<div class="gblog-nav__control">
<label for="menu-control" class="flex align-center justify-center">
<svg class="icon gblog_menu"><use xlink:href="#gblog_menu"></use></svg>
<svg class="icon gblog_clear"><use xlink:href="#gblog_clear"></use></svg>
2021-11-23 15:53:25 +00:00
<span>Navigation</span>
2020-07-06 18:55:32 +00:00
</label>
</div>
<ul class="gblog-nav__list container flex flex-wrap justify-center menu-content">
{{ $currentPage := .RelPermalink }}
{{ if default true .Site.Params.GeekblogTagsToMenu }}
2020-07-06 18:55:32 +00:00
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
{{ with $.Site.GetPage (printf "/tags/%s" $name) }}
<li>
<a class="gblog-nav__entry {{ if eq $currentPage .RelPermalink }} is-active {{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a>
2020-07-06 18:55:32 +00:00
</li>
{{ end }}
{{ end }}
{{ end }}
{{ if .Site.Data.menu.extra.header }}
{{ partial "menu-extra" (dict "current" . "source" .Site.Data.menu.extra.header "target" "header") }}
{{ end }}
2020-07-06 18:55:32 +00:00
</ul>
</nav>