From 1c6bd7d156d5627fa9808fb0e0300fb17327ebc4 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Thu, 26 Sep 2024 18:03:18 +0200 Subject: Refine site language, direction and code --- exampleSite/config/_default/config.yaml | 5 +---- exampleSite/config/_default/languages.yaml | 3 ++- layouts/_default/baseof.html | 9 +++++++-- layouts/_default/home.manifest.webmanifest | 6 ++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml index 7dc1335..719eebb 100644 --- a/exampleSite/config/_default/config.yaml +++ b/exampleSite/config/_default/config.yaml @@ -1,9 +1,6 @@ # You may need to change this line for your real project. baseURL: / -languageCode: en-us -defaultContentLanguage: en - # Keep title short to prevent overflow. # There’s no official guidance on this, but 40 characters for # mobile and 60 for desktop is roughly the sweet spot. @@ -15,7 +12,7 @@ title: Ed. enableRobotsTXT: true # When using ref or relref to resolve page links and a link cannot -# resolved, it will be logged with this log level. +# resolve, it will be logged with this log level. refLinksErrorLevel: WARNING # Kick out RSS, we'll use Atom and FEED bellow. diff --git a/exampleSite/config/_default/languages.yaml b/exampleSite/config/_default/languages.yaml index 9f1a04b..ae49ea4 100644 --- a/exampleSite/config/_default/languages.yaml +++ b/exampleSite/config/_default/languages.yaml @@ -1,4 +1,5 @@ en: - weight: 1 + languageCode: en languageDirection: ltr languageName: English + weight: 1 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 5f095c2..30d98e2 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,10 @@ - - + + {{ partial "head.html" . }}
diff --git a/layouts/_default/home.manifest.webmanifest b/layouts/_default/home.manifest.webmanifest index 53c2dec..e43108e 100644 --- a/layouts/_default/home.manifest.webmanifest +++ b/layouts/_default/home.manifest.webmanifest @@ -6,8 +6,8 @@ "name": {{ site.Title | htmlUnescape | jsonify }}, {{ with site.Params.tagline }}"short_name": {{ . | htmlUnescape | jsonify }},{{ end }} {{ with site.Params.description }}"description": {{ . | htmlUnescape | jsonify }},{{ end }} - "lang": "{{ site.LanguageCode | default site.Language.Lang }}",{{ with partialCached "func/GetLanguageDirection" "GetLanguageDirection" }} - "dir": {{ . | jsonify }},{{ end }} + "lang": "{{ site.Language.LanguageCode }}", + "dir": "{{ or site.Language.LanguageDirection `ltr` }}", "start_url": {{ (printf "/%s" $url) | jsonify }}, "display": "fullscreen", "theme_color": "#ffffff", @@ -30,5 +30,3 @@ }{{ if ne . 512 }},{{ end }}{{- end }} ] } - - -- cgit v1.2.3