refactor(layout): keep content width fixed and document CSS var override (#934)

* fix(layout): split page and content width configuration

* refactor(layout): consolidate page width settings and update documentation

- Removed separate content width configuration from `hugo.yaml` and set a default value of `72rem` in CSS.
- Updated documentation in multiple languages to reflect the changes in page and content width settings, emphasizing the new fixed content width and customization options.
This commit is contained in:
Xin
2026-02-19 23:54:43 +00:00
committed by GitHub
parent 55659bb9c1
commit 8f6aa1db5b
6 changed files with 58 additions and 16 deletions

View File

@@ -1,15 +1,14 @@
/* Hugo template to derive CSS variables from site and page parameters */
/* Do not remove the following comment. It is used by Hugo to render CSS variables.
{{- $pageWidth := site.Params.page.width -}}
{{- $maxPageWidth := cond (eq $pageWidth "wide") "90rem" (cond (eq $pageWidth "full") "100%" "80rem") -}}
{{- $maxContentWidth := cond (eq $pageWidth "wide") "80rem" (cond (eq $pageWidth "full") "100%" "72rem") -}}
{{- $layoutWidthValues := dict "normal" "80rem" "wide" "90rem" "full" "100%" -}}
{{- $layoutWidthDefault := index $layoutWidthValues "normal" -}}
{{- $navbarWidth := site.Params.navbar.width -}}
{{- $maxNavbarWidth := cond (eq $navbarWidth "wide") "90rem" (cond (eq $navbarWidth "full") "100%" "80rem") -}}
{{- $maxPageWidth := (index $layoutWidthValues (site.Params.page.width | default "normal")) | default $layoutWidthDefault -}}
{{- $maxNavbarWidth := (index $layoutWidthValues (site.Params.navbar.width | default "normal")) | default $layoutWidthDefault -}}
{{- $maxFooterWidth := (index $layoutWidthValues (site.Params.footer.width | default "normal")) | default $layoutWidthDefault -}}
{{- $footerWidth := site.Params.footer.width -}}
{{- $maxFooterWidth := cond (eq $footerWidth "wide") "90rem" (cond (eq $footerWidth "full") "100%" "80rem") -}}
{{- $maxContentWidth := "72rem" -}}
*/
:root {