Welcome to mirror list, hosted at ThFree Co, Russian Federation.

breadcrumb.html « component « main « partials « layouts - github.com/zzossig/hugo-theme-zdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1f16ce1c43c808d9be3bc92fa2d3bbf27355660a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<nav class="breadcrumb" aria-label="breadcrumbs" data-is-blog="{{ if eq .Type "blog" }}true{{ else }}false{{ end }}">
  <ol>
    {{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
  </ol>
  {{ define "breadcrumbnav" }}
  {{ if .p1.Parent }}
  {{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 )  }}
  {{ else if not .p1.IsHome }}
  {{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 )  }}
  {{ end }}
  <li {{ if eq .p1 .p2 }} class="is-active" {{ end }}>
    {{ if eq (len .p1.Title) 0 }}
      <a href="{{ .p1.Permalink }}" class="capitalize">{{ .p1.Site.Title }}</a>
    {{ else if eq .p1 .p2 }}
      <span>{{ i18n (lower .p1.Title) | default .p1.Title }}</span>
    {{ else }}
      <a href="{{ .p1.Permalink }}" class="capitalize">{{ i18n (lower .p1.Title) | default .p1.Title }}</a>
    {{ end }}
  </li>
  {{ end }}
</nav>