mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-22 02:21:37 +01:00
use local scratch var in breadcrumbs
- fix undisplayed breadcrumbs in section pages having pagination
This commit is contained in:
parent
1a8e14a848
commit
034da04180
@ -4,10 +4,11 @@
|
|||||||
{{- $lang_url := replace $url ( printf "%s" .Lang) "" }}
|
{{- $lang_url := replace $url ( printf "%s" .Lang) "" }}
|
||||||
|
|
||||||
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a>
|
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a>
|
||||||
|
{{- $scratch := newScratch }}
|
||||||
{{- range $index, $element := split $lang_url "/" }}
|
{{- range $index, $element := split $lang_url "/" }}
|
||||||
|
|
||||||
{{- $.Scratch.Add "path" (printf "%s/" $element )}}
|
{{- $scratch.Add "path" (printf "%s/" $element )}}
|
||||||
{{- $bc_pg := $.Site.GetPage ($.Scratch.Get "path") -}}
|
{{- $bc_pg := $.Site.GetPage ($scratch.Get "path") -}}
|
||||||
|
|
||||||
{{- if (and ($bc_pg) (gt (len . ) 0))}}
|
{{- if (and ($bc_pg) (gt (len . ) 0))}}
|
||||||
{{- print " » " | safeHTML -}}<a href="{{ $bc_pg.Permalink }}">{{ $bc_pg.Name }}</a>
|
{{- print " » " | safeHTML -}}<a href="{{ $bc_pg.Permalink }}">{{ $bc_pg.Name }}</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user