Add new locale picker and related improvements

Closes: #583
This commit is contained in:
James Panther
2023-09-12 09:22:49 +10:00
parent 1e90d7f077
commit ad8a1b0390
31 changed files with 255 additions and 107 deletions
+2 -5
View File
@@ -1,8 +1,5 @@
<head>
<meta charset="utf-8" />
{{ with site.Params.htmlCode | default .Site.LanguageCode }}
<meta http-equiv="content-language" content="{{ . }}" />
{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="rgb(255,255,255)" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
@@ -17,7 +14,7 @@
{{/* Metadata */}}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
{{ with union .Site.Params.keywords .Params.keywords -}}
<meta name="keywords" content="{{ delimit . `, `}}" />
<meta name="keywords" content="{{ delimit . `, ` }}" />
{{- end }}
{{ with .Site.Params.robots }}
<meta name="robots" content="{{ . }}" />
@@ -62,7 +59,7 @@
{{ $jsCode := resources.Get "js/code.js" }}
{{ $assets.Add "js" (slice $jsCode) }}
{{ end }}
{{ if .Site.Params.rtl | default false }}
{{ if eq (site.Language.LanguageDirection | default "ltr") "rtl" }}
{{ $jsRTL := resources.Get "js/rtl.js" }}
{{ $assets.Add "js" (slice $jsRTL) }}
{{ end }}