Fix breadcrumbs to actually be a nav element

master
Maik de Kruif 18 hours ago
parent 83e5be25e3
commit 82b5a211b4
No known key found for this signature in database
GPG Key ID: DB1A8C782DD43CB3
  1. 14
      themes/maik-blog/assets/scss/_main.scss
  2. 2
      themes/maik-blog/layouts/_default/list.html
  3. 2
      themes/maik-blog/layouts/_default/single.html
  4. 6
      themes/maik-blog/layouts/partials/breadcrumbs.html
  5. 2
      themes/maik-blog/layouts/portfolio/list.html
  6. 2
      themes/maik-blog/layouts/portfolio/single.html
  7. 6
      themes/maik-blog/layouts/writeups/list.html

@ -464,3 +464,17 @@ table {
.nostyle { .nostyle {
text-decoration: none; text-decoration: none;
} }
.breadcrumbs {
display: inline;
ol {
list-style-type: none;
margin: 0;
display: inline;
li {
display: inline;
}
}
}

@ -2,7 +2,7 @@
{{ $paginator := .Paginate .Data.Pages }} {{ $paginator := .Paginate .Data.Pages }}
<main class="posts"> <main class="posts">
<p class="posts-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">" "min" 1) }}</p> <div class="posts-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">" "min" 1) }}</div>
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>

@ -25,7 +25,7 @@
</div> </div>
<article> <article>
<p class="post-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">" "min" 1) }}</p> <div class="post-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">" "min" 1) }}</div>
<h1 class="post-title"> <h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>

@ -16,11 +16,17 @@
{{- $breadcrumbs = after (int .page.IsPage) $breadcrumbs}} {{- $breadcrumbs = after (int .page.IsPage) $breadcrumbs}}
{{- if ne .page.Type "page"}} {{- if ne .page.Type "page"}}
{{- if lt (default 0 .min) (len $breadcrumbs) }} {{- if lt (default 0 .min) (len $breadcrumbs) }}
<nav aria-label="breadcrumb" class="breadcrumbs">
<ol>
{{- range $index, $breadcrumb := $breadcrumbs }} {{- range $index, $breadcrumb := $breadcrumbs }}
<li>
<a href="{{ $breadcrumb.url }}">{{ $breadcrumb.name }}</a>{{ if ne $index (sub (len $breadcrumbs) 1) }}<span> > </span>{{ end }} <a href="{{ $breadcrumb.url }}">{{ $breadcrumb.name }}</a>{{ if ne $index (sub (len $breadcrumbs) 1) }}<span> > </span>{{ end }}
</li>
{{- end }} {{- end }}
</ol>
{{- if and $breadcrumbs .end }} {{- if and $breadcrumbs .end }}
{{ .end }} {{ .end }}
{{- end }} {{- end }}
</nav>
{{- end }} {{- end }}
{{- end }} {{- end }}

@ -1,7 +1,7 @@
{{ define "main" }} {{ define "main" }}
<main class="portfolios"> <main class="portfolios">
<p class="posts-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">") }}</p> <div class="posts-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">") }}</div>
<h1>Portfolio</h1> <h1>Portfolio</h1>

@ -20,7 +20,7 @@
</div> </div>
<article> <article>
<p class="post-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">" "min" 1) }}</p> <div class="post-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">" "min" 1) }}</div>
<h1 class="portfolio-title"> <h1 class="portfolio-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>

@ -2,7 +2,7 @@
{{ $paginator := (.Paginate .RegularPagesRecursive) }} {{ $paginator := (.Paginate .RegularPagesRecursive) }}
<main class="posts"> <main class="posts">
<p class="posts-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">") }}</p> <div class="posts-breadcrumbs">{{ partial "breadcrumbs.html" (dict "page" . "end" ">") }}</div>
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
@ -19,14 +19,14 @@
<div class="post"> <div class="post">
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2> <h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
<p class="post-subtitle"> <div class="post-subtitle">
{{/* {{- with .Params.Subtitle }} {{/* {{- with .Params.Subtitle }}
{{ . | markdownify }} {{ . | markdownify }}
<br> <br>
{{- end }} */}} {{- end }} */}}
{{ partial "breadcrumbs.html" (dict "page" . "min" 0) }} {{ partial "breadcrumbs.html" (dict "page" . "min" 0) }}
</p> </div>
<div class="post-meta"> <div class="post-meta">
{{- if .Date }} {{- if .Date }}

Loading…
Cancel
Save