Add breadcrumbs for content
This commit is contained in:
parent
6267296870
commit
050ffa0b58
4 changed files with 26 additions and 0 deletions
5
layouts/partials/breadcrumbs/index.html
Normal file
5
layouts/partials/breadcrumbs/index.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<nav aria-label="breadcrumb" role="navigation">
|
||||
<ol class="breadcrumb">
|
||||
{{ partial "breadcrumbs/item.html" (dict "page" . "current" .) }}
|
||||
</ol>
|
||||
</nav>
|
7
layouts/partials/breadcrumbs/item.html
Normal file
7
layouts/partials/breadcrumbs/item.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{ if .page.Parent }}{{ if not .page.Parent.IsHome }}
|
||||
{{ partial "breadcrumbs/item.html" (dict "page" .page.Parent "current" .current) }}
|
||||
{{ end }}{{ end }}
|
||||
|
||||
{{ if ne .page .current }}
|
||||
<li class="breadcrumb-item"><a href="{{ .page.Permalink }}">{{ .page.LinkTitle }}</a></li>
|
||||
{{ end }}
|
|
@ -1,6 +1,7 @@
|
|||
{{ if .Params.image }}
|
||||
<div class="mb-3 image header-image" data-image="{{ .Params.image }}"></div>
|
||||
{{ end }}
|
||||
{{ partial "breadcrumbs/index.html" . }}
|
||||
<h1 class="display-5">{{ .Title }}</h1>
|
||||
<h5 class="my-3">{{ partial "subtitle.html" . }}</h5>
|
||||
<p>{{ partial "content-details.html" . }}</p>
|
||||
|
|
|
@ -211,3 +211,16 @@ p code, li code {
|
|||
.tag {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
background-color: initial;
|
||||
padding: 0;
|
||||
font-size: $spacer * 0.9;
|
||||
margin-bottom: 0;
|
||||
margin-top: $spacer * 1.5;
|
||||
|
||||
.breadcrumb-item + .breadcrumb-item::before {
|
||||
padding: 0 0.2rem;
|
||||
color: $black;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue