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

@@ -342,7 +342,7 @@ params:
### عرض صفحه
عرض صفحه را می‌توان با پارامتر `params.page.width` در فایل پیکربندی سفارشی کرد:
عرض پوستهٔ صفحه را می‌توان با پارامتر `params.page.width` تنظیم کرد:
```yaml {filename="hugo.yaml"}
params:
@@ -351,7 +351,17 @@ params:
width: wide
```
سه گزینه موجود است: `full`, `wide`, و `normal`. به طور پیش‌فرض، عرض صفحه روی `normal` تنظیم شده است.
گزینه‌های `params.page.width`: `full`، `wide`، و `normal`.
عرض محتوای اصلی به صورت پیش‌فرض روی `72rem` ثابت است.
برای سفارشی‌سازی عرض محتوا، متغیر CSS را در فایل استایل سفارشی خود بازنویسی کنید:
```css {filename="assets/css/custom.css"}
:root {
--hextra-max-content-width: 100%;
}
```
به طور مشابه، عرض نوار ناوبری و پاورقی را می‌توان با پارامترهای `params.navbar.width` و `params.footer.width` سفارشی کرد.

View File

@@ -342,7 +342,7 @@ params:
### ページ幅
ページの幅は設定ファイルの `params.page.width` パラメータでカスタマイズできます:
レイアウト全体の幅は `params.page.width` で設定できます:
```yaml {filename="hugo.yaml"}
params:
@@ -351,7 +351,17 @@ params:
width: wide
```
利用可能なオプションは `full`、`wide`、`normal` の3つです。デフォルトではページ幅は `normal` に設定されています。
`params.page.width` の選択肢は `full`、`wide`、`normal` す。
本文コンテンツ幅はデフォルトで `72rem` に固定されています。
コンテンツ幅を変更したい場合は、カスタムスタイルシートで CSS 変数を上書きしてください:
```css {filename="assets/css/custom.css"}
:root {
--hextra-max-content-width: 100%;
}
```
同様に、ナビゲーションバーとフッターの幅は `params.navbar.width` と `params.footer.width` パラメータでカスタマイズできます。

View File

@@ -364,7 +364,7 @@ params:
### Page Width
The width of the page can be customized by the `params.page.width` parameter in the config file:
The layout shell width can be customized by the `params.page.width` parameter in the config file:
```yaml {filename="hugo.yaml"}
params:
@@ -373,7 +373,17 @@ params:
width: wide
```
There are three available options: `full`, `wide`, and `normal`. By default, the page width is set to `normal`.
Available options for `params.page.width`: `full`, `wide`, `normal`.
The main reading content width remains fixed at `72rem` by default.
To customize content width, override the CSS variable in your custom stylesheet:
```css {filename="assets/css/custom.css"}
:root {
--hextra-max-content-width: 100%;
}
```
Similarly, the width of the navbar and footer can be customized by the `params.navbar.width` and `params.footer.width` parameters.

View File

@@ -342,7 +342,7 @@ params:
### 页面宽度
页面宽度可通过配置文件中的 `params.page.width` 参数自定义
页面整体布局宽度可通过 `params.page.width` 配置
```yaml {filename="hugo.yaml"}
params:
@@ -351,7 +351,17 @@ params:
width: wide
```
有三个可用选项:`full`、`wide` 和 `normal`。默认页面宽度为 `normal`。
`params.page.width` 可用选项:`full`、`wide`、`normal`。
正文内容宽度默认固定为 `72rem`。
如需自定义内容宽度,请在自定义样式表中覆盖 CSS 变量:
```css {filename="assets/css/custom.css"}
:root {
--hextra-max-content-width: 100%;
}
```
类似地,导航栏和页脚的宽度可以通过 `params.navbar.width` 和 `params.footer.width` 参数自定义。