Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions assets/scss/_breadcrumb.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// Breadcrumb

.breadcrumb {
background: none;
padding-left: 0;
padding-top: 0;
}
.td-breadcrumbs {
@media print {display: none !important; }

.breadcrumb {
background: inherit;
padding-left: 0;
padding-top: 0;
}
}
38 changes: 20 additions & 18 deletions layouts/partials/breadcrumb.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<nav aria-label="breadcrumb" class="d-none d-md-block d-print-none">
<ol class="breadcrumb spb-1">
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
</nav >
{{ define "breadcrumbnav" }}
{{ if .p1.Parent }}
{{ if not .p1.Parent.IsHome }}
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) }}
{{ end }}
{{ else if not .p1.IsHome }}
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
{{ end }}
{{ $isActive := eq .p1 .p2 }}
<li class="breadcrumb-item{{ if $isActive }} active{{ end }}" {{ if $isActive }}aria-current="page"{{ end }}>
<a href="{{ .p1.Permalink }}">{{ .p1.LinkTitle }}</a>
</li>
{{ end }}
<nav aria-label="breadcrumb" class="td-breadcrumbs">
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only significant change here is the use of the td-breadcrumbs class. Every other change in the partial is a whitespace fix.

<ol class="breadcrumb spb-1">
{{- template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
</nav>

{{- define "breadcrumbnav" -}}
{{ if .p1.Parent -}}
{{ if not .p1.Parent.IsHome -}}
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) -}}
{{ end -}}
{{ else if not .p1.IsHome -}}
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) -}}
{{ end -}}
{{ $isActive := eq .p1 .p2 }}
<li class="breadcrumb-item{{ if $isActive }} active{{ end }}"
{{- if $isActive }} aria-current="page"{{ end }}>
<a href="{{ .p1.Permalink }}">{{ .p1.LinkTitle }}</a>
</li>
{{- end -}}