feat: add optional breadcrumb trail
This commit is contained in:
parent
7eeba784db
commit
9c67aca368
|
@ -38,3 +38,8 @@ p.meta {
|
|||
margin-top: 0.5rem;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin-top: 2.25rem;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
|
|
@ -53,3 +53,4 @@ editPage = false
|
|||
flexSearch = true
|
||||
darkMode = true
|
||||
bootStrapJs = false
|
||||
breadCrumb = false
|
||||
|
|
|
@ -15,6 +15,15 @@
|
|||
{{ else -}}
|
||||
<main class="docs-content col-lg-11 col-xl-9 mx-xl-auto">
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.options.breadCrumb -}}
|
||||
<!-- https://discourse.gohugo.io/t/breadcrumb-navigation-for-highly-nested-content/27359/6 -->
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
{{ partial "main/breadcrumb" . -}}
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ .Title }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
{{ end }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
<p class="lead">{{ .Params.lead | safeHTML }}</p>
|
||||
{{ partial "main/headline-hash.html" .Content }}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
{{ with .Parent -}}
|
||||
{{ partial "main/breadcrumb.html" . -}}
|
||||
<li class="breadcrumb-item"><a href="{{ .Permalink }}">{{ if .IsHome }}Home{{ else }}{{ .Title }}{{ end }}</a></li>
|
||||
{{ end -}}
|
Loading…
Reference in New Issue