From 3cc59954496133ba1a801e074f9670e9f9e35cef Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Sun, 4 Jun 2023 15:18:31 +0600 Subject: [PATCH] update breadcrumb and lang-switcher --- layouts/partials/components/breadcrumb.html | 28 +++++++++++-------- .../components/language-switcher.html | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/layouts/partials/components/breadcrumb.html b/layouts/partials/components/breadcrumb.html index 375c863..7bcd3cd 100644 --- a/layouts/partials/components/breadcrumb.html +++ b/layouts/partials/components/breadcrumb.html @@ -1,9 +1,9 @@ {{ $context := .Context }} {{ $class := .Class }} {{ $base := site.BaseURL }} -{{ $url := replace $context.Permalink ( printf "%s" $base) "" }} +{{ $pageLink := replace $context.Permalink $base "" }} {{ $lang := $context.Lang }} -{{ $.Scratch.Add "path" $base }} +{{ $context.Scratch.Set "path" "/" }} diff --git a/layouts/partials/components/language-switcher.html b/layouts/partials/components/language-switcher.html index 06d310d..330baed 100644 --- a/layouts/partials/components/language-switcher.html +++ b/layouts/partials/components/language-switcher.html @@ -4,7 +4,7 @@ {{ $pageLang := $context.Lang }} {{ $base:= urls.Parse site.BaseURL }} {{ $siteLanguages := site.Home.AllTranslations }} -{{ $pageLink := replace (replace (replace $context.RelPermalink $pageLang "") "//" "/") $base.Path "" }} +{{ $pageLink := replace (replace (replace $context.RelPermalink $pageLang "") "//" "/") $base.Path "/" }} {{ if $context.IsTranslated }}