git: 1971d0d1ff - main - website: Modernize and simplify language logic
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 02 Apr 2026 19:29:16 UTC
The branch main has been updated by ziaee:
URL: https://cgit.FreeBSD.org/doc/commit/?id=1971d0d1ff1d9b059eb15377e08c41b397b5a1ed
commit 1971d0d1ff1d9b059eb15377e08c41b397b5a1ed
Author: Alexander Ziaee <ziaee@FreeBSD.org>
AuthorDate: 2026-04-02 19:27:05 +0000
Commit: Alexander Ziaee <ziaee@FreeBSD.org>
CommitDate: 2026-04-02 19:28:17 +0000
website: Modernize and simplify language logic
The website has really complex deprecated hugo logic for localization.
To simplify this and eliminate linter warnings, we first need a modern
hugo language key. Build that in hugo.toml, and remove all the extra
files related to the old way of doing this. This removes several INFO
messages about deprecated syntax during the build, increases clarity
of the build system, and allows us to begin transitioning off the
remaining deprecated elements.
Reviewed by: carlavilla
Differential Revision: https://reviews.freebsd.org/D56173
---
website/config/_default/languages.en.toml | 4 ----
website/config/_default/languages.ru.toml | 4 ----
website/config/_default/languages.zh-tw.toml | 4 ----
website/{config/_default => }/hugo.toml | 14 ++++++++++++++
website/themes/beastie/layouts/baseof.html | 2 +-
website/themes/beastie/theme.toml | 2 +-
6 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/website/config/_default/languages.en.toml b/website/config/_default/languages.en.toml
deleted file mode 100644
index 120628c13c..0000000000
--- a/website/config/_default/languages.en.toml
+++ /dev/null
@@ -1,4 +0,0 @@
-title = "The FreeBSD Project"
-contentDir = "content/en"
-languageName = "English"
-weight = 1
diff --git a/website/config/_default/languages.ru.toml b/website/config/_default/languages.ru.toml
deleted file mode 100644
index 7dfbab8551..0000000000
--- a/website/config/_default/languages.ru.toml
+++ /dev/null
@@ -1,4 +0,0 @@
-title = "The FreeBSD Project"
-contentDir = "content/ru"
-languageName = "Russian"
-weight = 12
diff --git a/website/config/_default/languages.zh-tw.toml b/website/config/_default/languages.zh-tw.toml
deleted file mode 100644
index 3c37da111a..0000000000
--- a/website/config/_default/languages.zh-tw.toml
+++ /dev/null
@@ -1,4 +0,0 @@
-title = "The FreeBSD Project"
-contentDir = "content/zh-tw"
-languageName = "繁體中文"
-weight = 6
diff --git a/website/config/_default/hugo.toml b/website/hugo.toml
similarity index 82%
rename from website/config/_default/hugo.toml
rename to website/hugo.toml
index 0c1d93f723..22e19c1cb1 100644
--- a/website/config/_default/hugo.toml
+++ b/website/hugo.toml
@@ -49,3 +49,17 @@ IsHTML = true
IsPlainText = false
noUgly = true
Rel = "alternate"
+
+[languages]
+ [languages.en]
+ contentDir = "content/en"
+ label = "English"
+ weight = 1
+ [languages.ru]
+ contentDir = "content/ru"
+ label = "Russian"
+ weight = 2
+ [languages.zh-tw]
+ contentDir = "content/zh-tw"
+ label = "繁體中文"
+ weight = 3
diff --git a/website/themes/beastie/layouts/baseof.html b/website/themes/beastie/layouts/baseof.html
index 46d88a99a9..7ecbe294ee 100644
--- a/website/themes/beastie/layouts/baseof.html
+++ b/website/themes/beastie/layouts/baseof.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="{{ $.Site.LanguageCode | default "en" }}">
+<html lang="{{ .Site.Language.Name }}">
{{ partial "site-head.html" . }}
<body>
<div id="container">
diff --git a/website/themes/beastie/theme.toml b/website/themes/beastie/theme.toml
index 5058603475..74a6ee7a06 100644
--- a/website/themes/beastie/theme.toml
+++ b/website/themes/beastie/theme.toml
@@ -3,7 +3,7 @@ copyright = "BSD 2-clause 'Simplified' License"
description = "Theme to build the FreeBSD website"
homepage = "https://www.freebsd.org"
tags = ["website", "freebsd", "bsd"]
-min_version = "0.146.0"
+min_version = "0.153.0"
[author]
name = "Sergio Carlavilla"