diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2022-01-13 19:19:54 +0100 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2022-01-13 19:20:02 +0100 |
commit | 3a65df3a76e20ae3f9926aaa69ffc14a86fff055 (patch) | |
tree | e29ca0a35a8aa02e09657f629178b1e083147730 | |
parent | fb0863a27a28dfeb01db0f4f5ee6bfbaf3b67020 (diff) |
#408, #410: Use LanguageCode in templates if specified
-rw-r--r-- | layouts/_default/baseof.html | 4 | ||||
-rw-r--r-- | layouts/partials/docs/html-head.html | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3b2a7fc..49a3121 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,10 +1,10 @@ <!DOCTYPE html> -<html lang="{{ .Site.Language.Lang }}" dir="{{ .Site.Language.LanguageDirection | default "ltr" }}"> +<html lang="{{ default .Site.Language.Lang .Site.LanguageCode }}" dir="{{ default "ltr" .Site.Language.LanguageDirection }}"> <head> {{ partial "docs/html-head" . }} {{ partial "docs/inject/head" . }} </head> -<body dir="{{ .Site.Language.LanguageDirection | default "ltr" }}"> +<body dir="{{ default "ltr" .Site.Language.LanguageDirection }}"> <input type="checkbox" class="hidden toggle" id="menu-control" /> <input type="checkbox" class="hidden toggle" id="toc-control" /> <main class="container flex"> diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html index 141973a..ee855f6 100644 --- a/layouts/partials/docs/html-head.html +++ b/layouts/partials/docs/html-head.html @@ -13,7 +13,7 @@ <link rel="icon" href="{{ "favicon.png" | relURL }}" type="image/x-icon"> {{- range .Translations }} - <link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ partial "docs/title" . }}"> + <link rel="alternate" hreflang="{{ default .Language.Lang .Site.LanguageCode }}" href="{{ .Permalink }}" title="{{ partial "docs/title" . }}"> {{- end -}} <!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website --> |