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: f00cec0a949ddcf499d56e67e6d0c1ab66978a32 (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">
  <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>