breadcrumbs.html 668 B

1234567891011121314151617181920
  1. <ul class="breadcrumbs">
  2. {{ template "breadcrumb" dict "currentPage" .Page "id" .UniqueID }}
  3. </ul>
  4. <!-- templates -->
  5. {{ define "breadcrumb" }}
  6. {{ if .currentPage.Parent }}
  7. {{ template "breadcrumb" dict "currentPage" .currentPage.Parent }}
  8. {{ end }}
  9. {{ $title := cond (eq .currentPage.RelPermalink "/docs/" ) "Docs" (title .currentPage.Title) }}
  10. {{ if (ne .currentPage.Parent .IsHome) }}
  11. <li>
  12. {{ if eq .id .currentPage.UniqueID }}
  13. {{ $title }}
  14. {{ else }}
  15. <a href="{{ .currentPage.RelPermalink }}">{{ $title }}</a>
  16. {{ end }}
  17. </li>
  18. {{ end }}
  19. {{ end }}