diff options
Diffstat (limited to 'layouts/partials/breadcrumbs.html')
| -rw-r--r-- | layouts/partials/breadcrumbs.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html new file mode 100644 index 0000000..5532089 --- /dev/null +++ b/layouts/partials/breadcrumbs.html @@ -0,0 +1,18 @@ +{{- if (.Param "ShowBreadCrumbs")}} +<div class="breadcrumbs"> + {{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }} + {{- $lang_url := replace $url ( printf "%s" .Lang) "" }} + + <a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a> + {{- range $index, $element := split $lang_url "/" }} + + {{- $.Scratch.Add "path" (printf "%s/" $element )}} + {{- $bc_pg := $.Site.GetPage ($.Scratch.Get "path") -}} + + {{- if (and ($bc_pg) (gt (len . ) 0))}} + {{- print " ยป " | safeHTML -}}<a href="{{ $bc_pg.Permalink }}">{{ $bc_pg.Name }}</a> + {{- end }} + + {{- end }} +</div> +{{- end }} |
