aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/site-identity.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/site-identity.html')
-rw-r--r--layouts/partials/site-identity.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/layouts/partials/site-identity.html b/layouts/partials/site-identity.html
new file mode 100644
index 0000000..0f18d35
--- /dev/null
+++ b/layouts/partials/site-identity.html
@@ -0,0 +1,21 @@
+{{- $page := . -}}
+{{- $identity := strings.TrimSuffix "/" site.Params.identity -}}
+<nav class="site-identity" aria-label="Location">
+ <a class="site-root" href="{{ "/" | relURL }}">{{ $identity }}</a><span class="site-separator" aria-hidden="true">/</span>
+ {{- if not $page.IsHome -}}
+ {{- $path := strings.TrimSuffix "/" $page.RelPermalink -}}
+ {{- $path = strings.TrimSuffix ".html" $path -}}
+ {{- $prefix := "/" -}}
+ {{- $segments := split $path "/" -}}
+ {{- range $index, $segment := $segments -}}
+ {{- if ne $segment "" -}}
+ {{- $prefix = printf "%s%s/" $prefix $segment -}}
+ {{- if eq (add $index 1) (len $segments) -}}
+ <a class="site-current" href="{{ $page.RelPermalink }}" aria-current="page">{{ $segment }}</a><span class="site-separator" aria-hidden="true">/</span>
+ {{- else -}}
+ <a class="site-crumb" href="{{ $prefix | relURL }}">{{ $segment }}</a><span class="site-separator" aria-hidden="true">/</span>
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+</nav>