page_breadcrumb: Implement a breadcrumb and display it above the <main> content
The breadcrumb shows navigation from the home page as a path: / > Posts > This Post en.yaml
This commit is contained in:
parent
db3f1f40fa
commit
a5e5d04b9f
4 changed files with 47 additions and 0 deletions
13
layouts/partials/page_breadcrumb.html
Normal file
13
layouts/partials/page_breadcrumb.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<nav class="nav-breadcrumb">
|
||||
<ol>
|
||||
{{ range .Ancestors.Reverse }}
|
||||
{{- $title := .LinkTitle -}}
|
||||
{{- if .IsHome -}}
|
||||
{{ $title = "/" }}
|
||||
{{- end -}}
|
||||
<li><a href="{{ .Permalink }}">{{ $title }}</a></li>
|
||||
{{ end }}
|
||||
|
||||
<li class="nav-breadcrumb__active"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
||||
</ol>
|
||||
</nav>
|
Loading…
Add table
Add a link
Reference in a new issue