mirror of
https://github.com/tomfran/typo.git
synced 2025-04-26 05:29:54 +03:00
Merge pull request #95 from runofthemillgeek/feat/breadcrumbs-customization
Add breadcrumbs config to hide current page and change home text
This commit is contained in:
commit
338510e751
6 changed files with 47 additions and 16 deletions
|
@ -1,9 +1,23 @@
|
|||
{{ if .Site.Params.breadcrumbs }}
|
||||
{{- if .Site.Params.breadcrumbs.enabled -}}
|
||||
{{- $breadcrumbs := .Site.Params.breadcrumbs -}}
|
||||
<div class="breadcrumbs">
|
||||
{{ range .Ancestors.Reverse }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
<span class="breadcrumbs-separator"> / </span>
|
||||
{{ end }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{- range $i, $v := .Ancestors.Reverse -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{- if (and (eq $i 0) (ne $breadcrumbs.home "")) -}}
|
||||
{{- $breadcrumbs.home -}}
|
||||
{{- else -}}
|
||||
{{- .Title -}}
|
||||
{{- end -}}
|
||||
</a>
|
||||
|
||||
{{- if (lt $i (sub $.Ancestors.Len 1)) -}}
|
||||
<span class="breadcrumbs-separator">/</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $breadcrumbs.showCurrentPage -}}
|
||||
<span class="breadcrumbs-separator">/</span>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue