forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZH-CN translation of Usage part (go-gitea#5086)
- Loading branch information
1 parent
25def0a
commit 1972383
Showing
6 changed files
with
188 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
date: "2016-12-27T16:00:00+02:00" | ||
title: "使用指南" | ||
slug: "usage" | ||
weight: 35 | ||
toc: false | ||
draft: false | ||
menu: | ||
sidebar: | ||
name: "使用指南" | ||
weight: 35 | ||
identifier: "usage" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
docs/content/doc/usage/issue-pull-request-templates.zh-cn.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
date: "2018-05-10T16:00:00+02:00" | ||
title: "使用:Issue 和 Pull Request 模板" | ||
slug: "issue-pull-request-templates" | ||
weight: 15 | ||
toc: true | ||
draft: false | ||
menu: | ||
sidebar: | ||
parent: "usage" | ||
name: "Issue 和 Pull Request 模板" | ||
weight: 15 | ||
identifier: "issue-pull-request-templates" | ||
--- | ||
|
||
# 使用 Issue 和 Pull Request 模板 | ||
|
||
对于一些项目,在创建 issue 或 pull request 时有一个标准的询问列表需要提交者填写。Gitea 支持添加此类模板至 repository 的主分支,以便提交者在创建 issue 或 pull request 时可以自动生成一个需要完成的表单,这么做可以减少一些前期关于 issue 抑或 pull request 细节上的沟通成本。 | ||
|
||
以下罗列了一些可供参考的 issue 模板: | ||
|
||
* ISSUE_TEMPLATE.md | ||
* issue_template.md | ||
* .gitea/ISSUE_TEMPLATE.md | ||
* .gitea/issue_template.md | ||
* .github/ISSUE_TEMPLATE.md | ||
* .github/issue_template.md | ||
|
||
|
||
以下罗列了一些可供参考的 PR 模板: | ||
|
||
* PULL_REQUEST_TEMPLATE.md | ||
* pull_request_template.md | ||
* .gitea/PULL_REQUEST_TEMPLATE.md | ||
* .gitea/pull_request_template.md | ||
* .github/PULL_REQUEST_TEMPLATE.md | ||
* .github/pull_request_template.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
date: "2018-06-01T19:00:00+02:00" | ||
title: "使用:Pull Request" | ||
slug: "pull-request" | ||
weight: 13 | ||
toc: true | ||
draft: false | ||
menu: | ||
sidebar: | ||
parent: "usage" | ||
name: "Pull Request" | ||
weight: 13 | ||
identifier: "pull-request" | ||
--- | ||
|
||
# Pull Request | ||
|
||
## 在 pull requests 使用“Work In Progress”标记 | ||
|
||
您可以通过在一个进行中的 pull request 的标题上添加前缀 `WIP:` 或者 `[WIP]`(此处大小写敏感)来防止它被意外合并,具体的前缀设置可以在配置文件 `app.ini` 中找到: | ||
|
||
``` | ||
[repository.pull-request] | ||
WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP] | ||
``` | ||
|
||
列表的第一个值将用于 helpers 程序。 | ||
|
||
## Pull Request 模板 | ||
|
||
有关 pull request 模板的更多信息请您移步 : [Issue and Pull Request templates](../issue-pull-request-templates) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
date: "2018-05-22T11:00:00+00:00" | ||
title: "使用:反向代理" | ||
slug: "reverse-proxies" | ||
weight: 17 | ||
toc: true | ||
draft: false | ||
menu: | ||
sidebar: | ||
parent: "usage" | ||
name: "反向代理" | ||
weight: 16 | ||
identifier: "reverse-proxies" | ||
--- | ||
|
||
## 使用 Nginx 作为反向代理服务 | ||
|
||
如果您想使用 Nginx 作为 Gitea 的反向代理服务,您可以参照以下 `nginx.conf` 配置中 `server` 的 `http` 部分: | ||
|
||
``` | ||
server { | ||
listen 80; | ||
server_name git.example.com; | ||
location / { | ||
proxy_pass http://localhost:3000; | ||
} | ||
} | ||
``` | ||
|
||
## 使用 Nginx 作为反向代理服务并将 Gitea 路由至一个子路径 | ||
|
||
如果您已经有一个域名并且想与 Gitea 共享该域名,您可以增加以下 `nginx.conf` 配置中 `server` 的 `http` 部分,为 Gitea 添加路由规则: | ||
|
||
``` | ||
server { | ||
listen 80; | ||
server_name git.example.com; | ||
location /git/ { # Note: Trailing slash | ||
proxy_pass http://localhost:3000/; # Note: Trailing slash | ||
} | ||
} | ||
``` | ||
|
||
然后在您的 Gitea 配置文件中添加 `[server] ROOT_URL = http://git.example.com/git/`。 | ||
|
||
## 使用 Apache HTTPD 作为反向代理服务 | ||
|
||
如果您想使用 Apache HTTPD 作为 Gitea 的反向代理服务,您可以为您的 Apache HTTPD 作如下配置(在 Ubuntu 中,配置文件通常在 `/etc/apache2/httpd.conf` 目录下): | ||
|
||
``` | ||
<VirtualHost *:80> | ||
... | ||
ProxyPreserveHost On | ||
ProxyRequests off | ||
ProxyPass / http://localhost:3000/ | ||
ProxyPassReverse / http://localhost:3000/ | ||
</VirtualHost> | ||
``` | ||
|
||
注:必须启用以下 Apache HTTPD 组件:`proxy`, `proxy_http` | ||
|
||
## 使用 Apache HTTPD 作为反向代理服务并将 Gitea 路由至一个子路径 | ||
|
||
如果您已经有一个域名并且想与 Gitea 共享该域名,您可以增加以下配置为 Gitea 添加路由规则(在 Ubuntu 中,配置文件通常在 `/etc/apache2/httpd.conf` 目录下): | ||
|
||
``` | ||
<VirtualHost *:80> | ||
... | ||
<Proxy *> | ||
Order allow,deny | ||
Allow from all | ||
</Proxy> | ||
ProxyPass /git http://localhost:3000 # Note: no trailing slash after either /git or port | ||
ProxyPassReverse /git http://localhost:3000 # Note: no trailing slash after either /git or port | ||
</VirtualHost> | ||
``` | ||
|
||
然后在您的 Gitea 配置文件中添加 `[server] ROOT_URL = http://git.example.com/git/`。 | ||
|
||
注:必须启用以下 Apache HTTPD 组件:`proxy`, `proxy_http` | ||
|
||
## 使用 Caddy 作为反向代理服务 | ||
|
||
如果您想使用 Caddy 作为 Gitea 的反向代理服务,您可以在 `Caddyfile` 中添加如下配置: | ||
|
||
``` | ||
git.example.com { | ||
proxy / http://localhost:3000 | ||
} | ||
``` | ||
|
||
## 使用 Caddy 作为反向代理服务并将 Gitea 路由至一个子路径 | ||
|
||
如果您已经有一个域名并且想与 Gitea 共享该域名,您可以在您的 `Caddyfile` 文件中增加以下配置,为 Gitea 添加路由规则: | ||
|
||
``` | ||
git.example.com { | ||
proxy /git/ http://localhost:3000 # Note: Trailing Slash after /git/ | ||
} | ||
``` | ||
|
||
然后在您的 Gitea 配置文件中添加 `[server] ROOT_URL = http://git.example.com/git/`。 |