Update zh tw languages and fix some broken links (#455)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <2021+silverwind@noreply.gitea.com>
Reviewed-on: https://gitea.com/gitea/docs/pulls/455
Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com>
This commit is contained in:
Lunny Xiao
2026-07-09 23:41:46 +00:00
parent c0f8a04185
commit 965c269495
652 changed files with 30864 additions and 30792 deletions

View File

@@ -7,77 +7,77 @@ aliases:
- /zh-tw/customizing-gitea
---
# 自定义 Gitea 配置
# 自 Gitea 設定
Gitea 引用 `custom` 目錄中的自定义配置文件来覆盖配置、模板等默认配置
Gitea 引用 `custom` 目錄中的自訂設定文件來覆蓋設定、模板等預設設定
如果二進制部署 Gitea 所有默认路径都将相對於該 gitea 二進制文件;如果从发行版安裝,可能会将这些路修改為 Linux 文件系统标准。Gitea
将会自动建立包括 `custom/`的必要應用目錄,應用本身的配置存放在
`custom/conf/app.ini` 中。在行版中可能`/etc/gitea/` 的形式為 `custom` 设置一个符号链接,查看配置详情請移步:
如果二進制部署 Gitea 所有預設路徑都將相對於該 gitea 二進制文件;如果從發行版安裝,可能會將這些路修改為 Linux 文件系統標準。Gitea
將會自動建立包括 `custom/`的必要應用目錄,應用本身的設定存放在
`custom/conf/app.ini` 中。在行版中可能`/etc/gitea/` 的形式為 `custom` 設定一個符號鏈接,查看設定詳情請移步:
- [快速忘單](../administration/config-cheat-sheet.md)
- [完整配置清單](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
- [快速忘單](../administration/config-cheat-sheet.md)
- [完整設定清單](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
如果您在 binary 同目錄下無法找到 `custom` 文件,請查您的 `GITEA_CUSTOM`
环境变量配置 因為它可能被配置到了其他地方(可能被一些启动脚本设置指定了目錄)。
如果您在 binary 同目錄下無法找到 `custom` 文件,請查您的 `GITEA_CUSTOM`
環境變量設定 因為它可能被設定到了其他地方(可能被一些啟動腳本設定指定了目錄)。
- [环境变量清單](../administration/environment-variables.md)
- [環境變量清單](../administration/environment-variables.md)
**注:** 必須完全重 Gitea 以使配置生效。
**注:** 必須完全重 Gitea 以使設定生效。
## 使用自定义 /robots.txt
## 使用自 /robots.txt
[想要展示的](http://www.robotstxt.org/) 存放在 `custom` 目錄中的
`robots.txt` 文件来让 Gitea 使用自定义`/robots.txt` 默认:空 404
[想要展示的](http://www.robotstxt.org/) 存放在 `custom` 目錄中的
`robots.txt` 文件來讓 Gitea 使用自`/robots.txt` 預設:空 404
## 使用自定义的公共文件
## 使用自的公共文件
将自定义的公共文件(比如面和片)作為 webroot 放在 `custom/public/`来让 Gitea 提供些自定义内容(符号链接将被追)。
將自訂的公共文件(比如面和片)作為 webroot 放在 `custom/public/`來讓 Gitea 提供些自訂內容(符號鏈接將被追)。
举例说明:`image.png` 存放在 `custom/public/assets/`中,那它可以通過链接 http://gitea.domain.tld/assets/image.png 访问
舉例說明:`image.png` 存放在 `custom/public/assets/`中,那它可以透過鏈接 http://gitea.domain.tld/assets/image.png 訪問
## 修改默认头
## 修改預設頭
以下目錄中的 png 片: `custom/public/assets/img/avatar\_default.png`
以下目錄中的 png 片: `custom/public/assets/img/avatar\_default.png`
## 自定义 Gitea
## 自 Gitea
您可以改 Gitea `custom/templates` 的每个單页面。您可以在 Gitea 源`templates` 目錄中找到用于覆盖的模板文件,應用将根据
`custom/templates` 目錄下的路径结构進行匹配和覆
您可以改 Gitea `custom/templates` 的每個單頁面。您可以在 Gitea 源`templates` 目錄中找到用於覆蓋的模板文件,應用將根據
`custom/templates` 目錄下的路徑結構進行匹配和覆
包含在 `{{``}}` 中的任何句都是 Gitea 的模板法,如果您不完全理解这些组件,不建议您对它们進行修改。
包含在 `{{``}}` 中的任何句都是 Gitea 的模板法,如果您不完全理解這些元件,不建議您對它們進行修改。
### 添加接和页签
### 添加接和頁籤
如果您只是想添加外的接到顶部导航栏或额外的選卡到存儲库视图,您可以将它们放在您 `custom/templates/custom/` 目錄下的 `extra_links.tmpl``extra_tabs.tmpl` 文件中。
如果您只是想添加外的接到頂部導航欄或額外的選卡到儲存庫視圖,您可以將它們放在您 `custom/templates/custom/` 目錄下的 `extra_links.tmpl``extra_tabs.tmpl` 文件中。
举例说明:假您需要在站放置一个静态的“关于”页面,您只需将該页面放在您的
"custom/public/"目錄下(比如 `custom/public/impressum.html`)並且将它与 `custom/templates/custom/extra_links.tmpl` 接起即可。
舉例說明:假您需要在站放置一個靜態的“關於”頁面,您只需將該頁面放在您的
"custom/public/"目錄下(比如 `custom/public/impressum.html`)並且將它與 `custom/templates/custom/extra_links.tmpl` 接起即可。
这个链接應使用一名為“item”的 class 匹配当前样式,您可以使用 `{{AppSubUrl}}` 来获取 base URL:
這個鏈接應使用一名為“item”的 class 匹配當前樣式,您可以使用 `{{AppSubUrl}}` 來獲取 base URL:
`<a class="item" href="{{AppSubUrl}}/assets/impressum.html">Impressum</a>`
同理,您可以将页签添加到 `extra_tabs.tmpl` 中,使用同的方式添加页签。它的具體式需要
`templates/repo/header.tmpl` 中已有的其他選卡的式匹配
同理,您可以將頁籤添加到 `extra_tabs.tmpl` 中,使用同的方式添加頁籤。它的具體式需要
`templates/repo/header.tmpl` 中已有的其他選卡的式匹配
([source in GitHub](https://github.com/go-gitea/gitea/blob/main/templates/repo/header.tmpl))
### 面的其他新增
### 面的其他新增
除了 `extra_links.tmpl``extra_tabs.tmpl`,您可以在您的 `custom/templates/custom/` 目錄中存放一些其他有用的模板,例如:
- `header.tmpl`,在 `<head>` 标记结束之前的模板,例如添加自定义 CSS 文件
- `body_outer_pre.tmpl`,在 `<body>` 标记开始处的模板
- `body_inner_pre.tmpl`,在顶部导航栏之前,但在主 container 部的模板,例如添加一 `<div class="full height">`
- `body_inner_post.tmpl`,在主 container 结束处的模板
- `header.tmpl`,在 `<head>` 標記結束之前的模板,例如添加自 CSS 文件
- `body_outer_pre.tmpl`,在 `<body>` 標記開始處的模板
- `body_inner_pre.tmpl`,在頂部導航欄之前,但在主 container 部的模板,例如添加一 `<div class="full height">`
- `body_inner_post.tmpl`,在主 container 結束處的模板
- `body_outer_post.tmpl`,在底部 `<footer>` 元素之前.
- `footer.tmpl`,在 `<body>` 標籤结束处的模板,可以在这里填写一些附加的 Javascript 本。
- `footer.tmpl`,在 `<body>` 標籤結束處的模板,可以在這裡填寫一些附加的 Javascript 本。
## 自定义 gitignoreslabels licenses locales 以及 readmes
## 自 gitignoreslabels licenses locales 以及 readmes
将自定义文件放在 `custom/options` 下相應子的文件中即可
將自訂文件放在 `custom/options` 下相應子的文件中即可
## 更改 Gitea 外
## 更改 Gitea 外
置主是“gitea-light”、“gitea-dark”和“gitea-auto”动适應操作系统设置)。
置主是“gitea-light”、“gitea-dark”和“gitea-auto”動適應操作系統設定)。
默认主题可以`app.ini` 的 [ui](../administration/config-cheat-sheet.md#界面) 部分中的 `DEFAULT_THEME` 進行更改。
預設主題可以`app.ini` 的 [ui](../administration/config-cheat-sheet.md) 部分中的 `DEFAULT_THEME` 進行更改。