Breadcrumbs for only blog posts links to home page

Breadcrumbs got a lot easier when the Ancestors method was introduced a few years ago.

layouts/partials/breadcrumbs.html
{{ with .Ancestors.Reverse }}
  <nav class="nav-inline breadcrumbs">
    <ol>
      {{ $p := . | append $ }}
      {{ range $k, $_ := $p }}
        {{ if and (not $k) (ne $.Section "blog")}}
          {{ continue }}
        {{ end }}
        {{ if eq $k (sub (len $p) 1) }}
          <li><a aria-current="page" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
        {{ else }}
          <li><a aria-current="true" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
        {{ end }}
      {{ end }}
    </ol>
  </nav>
{{ end }}