Implementing breadcrumb navigation in hugo?

Working solution, thanks @bep

{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $.Scratch.Add "path" .Site.BaseURL }}
<ol class="breadcrumbs">
  <li><a href="/">home</a></li>
  {{ range $index, $element := split $url "/" }}
    {{ $.Scratch.Add "path" $element }}
      {{ if ne $element "" }}
      <li><a href='{{ $.Scratch.Get "path" }}'>{{ . }}</a></li>
      {{ $.Scratch.Add "path" "/" }}
      {{ end }}
  {{ end }}
</ol> 

3 Likes