[www-doc] [Git][VideoLAN.org/websites][hugo-rewrite] hugo: move language label and direction under params
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Tue May 5 10:39:01 UTC 2026
Felix Paul Kühne pushed to branch hugo-rewrite at VideoLAN organization / websites
Commits:
aadddc29 by Felix Paul Kühne at 2026-05-05T12:38:45+02:00
hugo: move language label and direction under params
- - - - -
4 changed files:
- www.videolan.org/bin/po2hugo.py
- www.videolan.org/layouts/_default/baseof.html
- www.videolan.org/layouts/partials/site/footer.html
- www.videolan.org/layouts/partials/site/head.html
Changes:
=====================================
www.videolan.org/bin/po2hugo.py
=====================================
@@ -211,10 +211,11 @@ def write_languages_toml(langs, out_path):
for i, lang in enumerate(ordered, start=1):
name = LANGUAGE_NAMES.get(lang, lang)
f.write(f"[{lang}]\n")
- f.write(f' label = "{name}"\n')
f.write(f" weight = {i}\n")
+ f.write(f" [{lang}.params]\n")
+ f.write(f' label = "{name}"\n')
if lang in RTL_LANGUAGES:
- f.write(' direction = "rtl"\n')
+ f.write(' direction = "rtl"\n')
f.write("\n")
=====================================
www.videolan.org/layouts/_default/baseof.html
=====================================
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="{{ site.Language.Lang }}"{{ if eq site.Language.Direction "rtl" }} dir="rtl"{{ end }}>
+<html lang="{{ site.Language.Lang }}"{{ if eq site.Language.Params.direction "rtl" }} dir="rtl"{{ end }}>
<head>
{{ partial "site/head.html" . }}
</head>
=====================================
www.videolan.org/layouts/partials/site/footer.html
=====================================
@@ -93,7 +93,7 @@
{{- range hugo.Sites }}
{{- $lang := .Language -}}
{{- $href := cond (eq $lang.Lang "en") $relPath (printf "/%s%s" $lang.Lang $relPath) -}}
- <option value="{{ $href }}"{{ if eq $lang.Lang $current }} selected{{ end }}>{{ $lang.Label }}</option>
+ <option value="{{ $href }}"{{ if eq $lang.Lang $current }} selected{{ end }}>{{ $lang.Params.label }}</option>
{{- end }}
</select>
</div>
=====================================
www.videolan.org/layouts/partials/site/head.html
=====================================
@@ -1,5 +1,5 @@
{{- $page := . -}}
-{{- $isRTL := eq site.Language.Direction "rtl" -}}
+{{- $isRTL := eq site.Language.Params.direction "rtl" -}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/commit/aadddc294f7b6fbd95557c5900e1e7ea833d692c
--
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/commit/aadddc294f7b6fbd95557c5900e1e7ea833d692c
You're receiving this email because of your account on code.videolan.org.
More information about the www-doc
mailing list