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

breadcrumb.html « partials « layouts - github.com/peaceiris/hugo-theme-iris.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2cf22b9accd72975ed843a03fb0e4dd1f73f9825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<nav class="breadcrumb" aria-label="breadcrumbs">
  <ul>
    {{- template "breadcrumb" (dict "node" . "start" .) -}}
  </ul>
</nav>

{{- define "breadcrumb" -}}
  {{- if .node.Parent -}}
    {{- template "breadcrumb" (dict "node" .node.Parent "start" .start) -}}
  {{- else if not .node.IsHome -}}
    {{- template "breadcrumb" (dict "node" .node.Site.Home "start" .start) -}}
  {{- end -}}

  {{- if eq .node .start -}}
    <li class="is-active">
      <button class="button is-dark is-outlined is-focused">
        <a href="#" aria-current="page">{{- .node.LinkTitle -}}</a>
      </button>
    </li>
  {{- else -}}
    <li>
      <button class="button is-dark">
        <a href="{{- .node.Permalink -}}">{{- .node.LinkTitle -}}</a>
      </button>
    </li>
  {{- end -}}
{{- end -}}