diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2022-03-27 18:44:06 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2022-03-27 18:44:06 +0530 |
| commit | 575cc0ca8c4e5904c7ae77e76db812c52e5f8ed1 (patch) | |
| tree | 29b83f765f6ccae88651886167681b4afdb71069 /layouts/partials/breadcrumbs.html | |
| parent | 975972e04181007c61302054d18735dc440a0586 (diff) | |
Use `site` function instead of `.Site` or `$.Site`
- The site function provides global access to the same data as the .Site page method.
- Current context (`.`) is never considered.
Diffstat (limited to 'layouts/partials/breadcrumbs.html')
| -rw-r--r-- | layouts/partials/breadcrumbs.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index 742254a..7e8257b 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -1,6 +1,6 @@ {{- if (.Param "ShowBreadCrumbs") -}} <div class="breadcrumbs"> - {{- $url := replace .Parent.Permalink (printf "%s" .Site.BaseURL) "" }} + {{- $url := replace .Parent.Permalink (printf "%s" site.BaseURL) "" }} {{- $lang_url := strings.TrimPrefix (printf "%s/" .Lang) $url -}} <a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home" }}</a> @@ -8,7 +8,7 @@ {{- range $index, $element := split $lang_url "/" }} {{- $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))}} {{- print " ยป " | safeHTML -}}<a href="{{ $bc_pg.Permalink }}">{{ $bc_pg.Name }}</a> |
