Merge pull request #166 from h-enk/doks-breadcrumb-navigation
Add optional breadcrumb trail
This commit is contained in:
commit
4a3e093978
|
@ -38,3 +38,8 @@ p.meta {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
font-size: $font-size-base;
|
font-size: $font-size-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
margin-top: 2.25rem;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
}
|
||||||
|
|
|
@ -53,3 +53,4 @@ editPage = false
|
||||||
flexSearch = true
|
flexSearch = true
|
||||||
darkMode = true
|
darkMode = true
|
||||||
bootStrapJs = false
|
bootStrapJs = false
|
||||||
|
breadCrumb = false
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="col-lg-5 col-xl-4 docs-sidebar">
|
<div class="col-lg-5 col-xl-4 docs-sidebar">
|
||||||
<nav class="docs-links" aria-label="Main navigation">
|
<nav class="docs-links" aria-label="Main navigation">
|
||||||
{{ partial "sidebar/docs-menu.html" . }}
|
{{ partial "sidebar/docs-menu.html" . }}
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
{{ if ne .Params.toc false -}}
|
{{ if ne .Params.toc false -}}
|
||||||
<nav class="docs-toc d-none d-xl-block col-xl-3" aria-label="Secondary navigation">
|
<nav class="docs-toc d-none d-xl-block col-xl-3" aria-label="Secondary navigation">
|
||||||
|
@ -15,6 +15,15 @@
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
<main class="docs-content col-lg-11 col-xl-9 mx-xl-auto">
|
<main class="docs-content col-lg-11 col-xl-9 mx-xl-auto">
|
||||||
{{ end -}}
|
{{ 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>
|
<h1>{{ .Title }}</h1>
|
||||||
<p class="lead">{{ .Params.lead | safeHTML }}</p>
|
<p class="lead">{{ .Params.lead | safeHTML }}</p>
|
||||||
{{ partial "main/headline-hash.html" .Content }}
|
{{ 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