update language-switcher

This commit is contained in:
somrat sorkar 2023-06-04 12:41:48 +06:00
parent fb0fa2d9ef
commit 4523fa4fc9

View File

@ -1,10 +1,10 @@
<!-- Language List --> <!-- Language List -->
{{ $class := .Class }} {{ $class := .Class }}
{{ $context := .Context }} {{ $context := .Context }}
{{ $siteLanguages := site.Home.AllTranslations }}
{{ $pageLang := $context.Lang }} {{ $pageLang := $context.Lang }}
{{ $pageLink := replace $context.RelPermalink $pageLang "" }} {{ $base:= urls.Parse site.BaseURL }}
{{ $pageLink = replace $pageLink "//" "/" }} {{ $siteLanguages := site.Home.AllTranslations }}
{{ $pageLink := replace (replace (replace $context.RelPermalink $pageLang "") "//" "/") $base.Path "" }}
{{ if $context.IsTranslated }} {{ if $context.IsTranslated }}
<select class="{{ $class }}" onchange="location = this.value"> <select class="{{ $class }}" onchange="location = this.value">