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

69 lines
2.7 KiB
HTML
Raw Normal View History

2020-07-06 18:55:32 +00:00
<header class="gblog-header">
<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.Home.Permalink }}">
<span class="gblog-brand flex align-center justify-center">
<img
class="gblog-brand__img"
src="{{ (default "brand.svg" .Site.Params.logo) | relURL }}"
alt=""
/>
<span class="gblog-brand__title">{{ .Site.Title }}</span>
</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-color-theme">
<svg class="gblog-icon gblog_brightness_dark">
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gblog_brightness_dark"></use>
</svg>
<svg class="gblog-icon gblog_brightness_light">
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gblog_brightness_light"></use>
</svg>
<svg class="gblog-icon gblog_brightness_auto">
<title>{{ i18n "button_toggle_dark" }}</title>
<use xlink:href="#gblog_brightness_auto"></use>
</svg>
</span>
2020-07-06 18:55:32 +00:00
</div>
</div>
2020-07-06 18:55:32 +00:00
</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="gblog-icon gblog_menu"><use xlink:href="#gblog_menu"></use></svg>
<svg class="gblog-icon gblog_clear"><use xlink:href="#gblog_clear"></use></svg>
<span>Navigation</span>
</label>
</div>
<ul class="gblog-nav__list container flex flex-wrap justify-center menu-content">
{{ $currentPage := .RelPermalink }}
{{ if default true .Site.Params.geekblogTagsToMenu }}
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
2020-07-06 18:55:32 +00:00
{{ with $.Site.GetPage (printf "/tags/%s" $name) }}
<li>
<a
class="gblog-nav__entry{{ if eq $currentPage .RelPermalink }}
{{ printf " %s" "is-active" }}
{{ end }}"
href="{{ .RelPermalink }}"
>
2022-02-06 11:46:10 +00:00
{{ partial "utils/title" . }}
2022-01-08 12:45:19 +00:00
</a>
</li>
{{ end }}
{{ end }}
{{ end }}
{{ if .Site.Data.menu.extra.header }}
{{ partial "menu-extra" (dict "current" . "source" .Site.Data.menu.extra.header "target" "header") }}
{{ end }}
</ul>
2020-07-06 18:55:32 +00:00
</nav>