From 4523fa4fc927445a8e7d8ad4dd54bc789712cf77 Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Sun, 4 Jun 2023 12:41:48 +0600 Subject: [PATCH] update language-switcher --- layouts/partials/components/language-switcher.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/components/language-switcher.html b/layouts/partials/components/language-switcher.html index 01dfca4..06d310d 100644 --- a/layouts/partials/components/language-switcher.html +++ b/layouts/partials/components/language-switcher.html @@ -1,10 +1,10 @@ {{ $class := .Class }} {{ $context := .Context }} -{{ $siteLanguages := site.Home.AllTranslations }} {{ $pageLang := $context.Lang }} -{{ $pageLink := replace $context.RelPermalink $pageLang "" }} -{{ $pageLink = replace $pageLink "//" "/" }} +{{ $base:= urls.Parse site.BaseURL }} +{{ $siteLanguages := site.Home.AllTranslations }} +{{ $pageLink := replace (replace (replace $context.RelPermalink $pageLang "") "//" "/") $base.Path "" }} {{ if $context.IsTranslated }}