<ul class="breadcrumbs">
    {{ template "breadcrumb" dict "currentPage" .Page "id" .UniqueID }}
</ul>

<!-- templates -->
{{ define "breadcrumb" }}
    {{ if .currentPage.Parent }}
        {{ template "breadcrumb" dict "currentPage" .currentPage.Parent }}
    {{ end }}
    {{ $title := cond (eq .currentPage.RelPermalink "/docs/" ) "Docs" (title .currentPage.Title) }}
    {{ if (ne .currentPage.Parent .IsHome) }}
        <li>
            {{ if eq .id .currentPage.UniqueID }}
                {{ $title }}
            {{ else }}
                <a href="{{ .currentPage.RelPermalink  }}">{{ $title }}</a>
            {{ end }}
        </li>
    {{ end }}
{{ end }}
