1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-20 12:12:09 +00:00
seirdy.one/layouts/partials/header.html

34 lines
1.3 KiB
HTML
Raw Normal View History

2022-04-02 05:21:00 +00:00
<header id="banner" itemscope itemtype="https://schema.org/WPHeader">
<a href="#content" class="skip">Skip to content</a>
2022-04-02 05:21:00 +00:00
<nav aria-label="Main navigation">
<ul class="unstyled-list">
{{- $currentPage := . -}}
{{- $isHome := false -}}
{{- if eq $currentPage.Permalink .Site.BaseURL -}}
{{- $isHome = true -}}
{{- end -}}
2022-04-02 05:21:00 +00:00
<li itemscope itemtype="https://schema.org/SiteNavigationElement">
<a rel="home" itemprop="url" href="{{ .Site.BaseURL }}"{{- if $isHome -}} aria-current="page"{{- end -}}>
{{- if $isHome -}}
<strong itemprop="name">{{ .Site.Title }}</strong>
{{- else -}}
<span itemprop="name">{{ .Site.Title }}</span>
{{- end -}}
</a>
2022-04-02 05:21:00 +00:00
</li>
{{ range .Site.Menus.main -}}
{{ $isCurrent := false }}
2022-04-02 05:21:00 +00:00
<li itemscope itemtype="https://schema.org/SiteNavigationElement">
<a href="{{ .URL }}" itemprop="url" {{- if or (eq $currentPage.RelPermalink .URL) ($currentPage.HasMenuCurrent "main" .) -}}{{- $isCurrent = true -}} aria-current="page"{{- end -}}>
{{- if or $isCurrent (eq $currentPage.Section .Title) -}}
<strong itemprop="name">{{- .Name -}}</strong>
{{- else -}}
<span itemprop="name">{{- .Name -}}</span>
{{- end -}}
</a>
2022-04-02 05:21:00 +00:00
</li>
{{- end }}
</ul>
</nav>
</header>