From 034da041800de60cfdfa6dbefc00f479f7c009cb Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Wed, 10 Feb 2021 21:43:45 +0530 Subject: [PATCH] use local scratch var in breadcrumbs - fix undisplayed breadcrumbs in section pages having pagination --- layouts/partials/breadcrumbs.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index 55320892..71ce58a2 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -4,10 +4,11 @@ {{- $lang_url := replace $url ( printf "%s" .Lang) "" }} {{ i18n "home" | default "Home"}} + {{- $scratch := newScratch }} {{- range $index, $element := split $lang_url "/" }} - {{- $.Scratch.Add "path" (printf "%s/" $element )}} - {{- $bc_pg := $.Site.GetPage ($.Scratch.Get "path") -}} + {{- $scratch.Add "path" (printf "%s/" $element )}} + {{- $bc_pg := $.Site.GetPage ($scratch.Get "path") -}} {{- if (and ($bc_pg) (gt (len . ) 0))}} {{- print " ยป " | safeHTML -}}{{ $bc_pg.Name }}