mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-15 01:42:10 +00:00
2204ae8861
- Semantically link each blog posting to the greater blog - Fix copyright bullshit - Make some articles TechArticles - Remove unnecessary markup
40 lines
1.4 KiB
HTML
40 lines
1.4 KiB
HTML
<header>
|
|
<nav aria-label="Global">
|
|
<ul>
|
|
{{- $currentPage := . -}}
|
|
{{- $canonicalRelPermalink := $currentPage.RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
|
{{- $isHome := false -}}
|
|
{{- if eq $currentPage.RelPermalink "/" -}}
|
|
{{- $isHome = true -}}
|
|
{{- end }}
|
|
<li
|
|
{{ if $isHome -}}
|
|
itemprop="sameAs"
|
|
{{ else -}}
|
|
itemprop="isPartOf"
|
|
{{ end -}}
|
|
itemscope itemtype="https://schema.org/Blog https://schema.org/WebSite"
|
|
itemid="{{ .Site.Params.CanonicalBaseURL }}/">
|
|
<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>
|
|
</li>
|
|
{{ range .Site.Menus.main -}}
|
|
{{ $isCurrent := false }}
|
|
<li itemProp="hasPart" 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>
|
|
</li>
|
|
{{- end }}
|
|
</ul>
|
|
</nav>
|
|
</header>
|