modified language switcher

This commit is contained in:
somrat sorkar 2023-06-05 16:48:12 +06:00
parent 3cc5995449
commit cef1b8593a

View File

@ -4,7 +4,7 @@
{{ $pageLang := $context.Lang }} {{ $pageLang := $context.Lang }}
{{ $base:= urls.Parse site.BaseURL }} {{ $base:= urls.Parse site.BaseURL }}
{{ $siteLanguages := site.Home.AllTranslations }} {{ $siteLanguages := site.Home.AllTranslations }}
{{ $pageLink := replace (replace (replace $context.RelPermalink $pageLang "") "//" "/") $base.Path "/" }} {{ $pageLink := replace (replace $context.RelPermalink (add $pageLang "/") "") $base.Path "/" }}
{{ if $context.IsTranslated }} {{ if $context.IsTranslated }}
<select class="{{ $class }}" onchange="location = this.value"> <select class="{{ $class }}" onchange="location = this.value">