Skip to content

Commit

Permalink
ZH-CN translation of Usage part (go-gitea#5086)
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaCat0 authored and techknowlogick committed Oct 17, 2018
1 parent 25def0a commit 1972383
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 2 deletions.
13 changes: 13 additions & 0 deletions docs/content/doc/usage.zh-cn.md
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"
---
2 changes: 1 addition & 1 deletion docs/content/doc/usage/backup-and-restore.zh-cn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
date: "2018-06-06T09:33:00+08:00"
title: "使用: 备份与恢复"
title: "使用备份与恢复"
slug: "backup-and-restore"
weight: 11
toc: true
Expand Down
37 changes: 37 additions & 0 deletions docs/content/doc/usage/issue-pull-request-templates.zh-cn.md
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
31 changes: 31 additions & 0 deletions docs/content/doc/usage/pull-request.zh-cn.md
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)
2 changes: 1 addition & 1 deletion docs/content/doc/usage/reverse-proxies.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration

Note: The following Apache HTTPD mods must be enabled: `proxy`, `proxy_http`

## Using Caddy with a Sub-path as a reverse proxy
## Using Caddy as a reverse proxy

If you want Caddy to serve your Gitea instance you can add the following server block to your Caddyfile:

Expand Down
105 changes: 105 additions & 0 deletions docs/content/doc/usage/reverse-proxies.zh-cn.md
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/`

0 comments on commit 1972383

Please sign in to comment.