1
0
Fork 0
forked from forgejo/forgejo

Add Chinese docs for help, contribution and development (#24925) (#25011)

Backport #24925, partially backport #24934
(`docs/content/doc/help/faq.zh-cn.md` file)

Part of backport has already done by #24942

Also backport #24881 to avoid "deadlock"

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
HesterG 2023-05-31 14:12:37 +08:00 committed by GitHub
parent d2c9fb02dd
commit 37b73b3337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 2705 additions and 0 deletions

View file

@ -0,0 +1,46 @@
---
date: "2023-05-25T17:29:00+08:00"
title: "集成"
slug: "integrations"
weight: 65
toc: false
draft: false
aliases:
- /zh-cn/integrations
menu:
sidebar:
parent: "development"
name: "集成"
weight: 65
identifier: "integrations"
---
# 集成
Gitea拥有一个出色的第三方集成社区以及在其他各种项目中的一流支持。
我们正在[awesome-gitea](https://gitea.com/gitea/awesome-gitea)上整理一个列表来跟踪这些集成!
如果你正在寻找[CI/CD](https://gitea.com/gitea/awesome-gitea#user-content-devops)
一个[SDK](https://gitea.com/gitea/awesome-gitea#user-content-sdk)
甚至一些额外的[主题](https://gitea.com/gitea/awesome-gitea#user-content-themes)
你可以在[awesome-gitea](https://gitea.com/gitea/awesome-gitea)中找到它们的列表!
## 预填新文件名和内容
如果你想打开一个具有给定名称和内容的新文件,
你可以使用查询参数来实现:
```txt
GET /{{org}}/{{repo}}/_new/{{filepath}}
?filename={{filename}}
&value={{content}}
```
例如:
```txt
GET https://git.example.com/johndoe/bliss/_new/articles/
?filename=hello-world.md
&value=Hello%2C%20World!
```

View file

@ -0,0 +1,40 @@
---
date: "2023-05-25T17:29:00+08:00"
title: "迁移界面"
slug: "migrations-interfaces"
weight: 55
toc: false
draft: false
aliases:
- /zh-cn/migrations-interfaces
menu:
sidebar:
parent: "development"
name: "迁移界面"
weight: 55
identifier: "migrations-interfaces"
---
# 迁移功能
完整迁移功能在Gitea 1.9.0版本中引入。它定义了两个接口用于支持从其他Git托管平台迁移存储库数据到Gitea或者在将来将Gitea数据迁移到其他Git托管平台。
目前已实现了从GitHub、GitLab和其他Gitea实例的迁移。
首先Gitea在包[modules/migration](https://github.com/go-gitea/gitea/tree/main/modules/migration)中定义了一些标准对象。它们是`Repository``Milestone``Release``ReleaseAsset``Label``Issue``Comment``PullRequest``Reaction``Review``ReviewComment`
## 下载器接口
要从新的Git托管平台迁移需要进行两个步骤的更新。
- 您应该实现一个`Downloader`,用于获取存储库信息。
- 您应该实现一个`DownloaderFactory`用于检测URL是否匹配并创建上述的`Downloader`
- 您需要在`init()`中通过`RegisterDownloaderFactory`注册`DownloaderFactory`
您可以在[downloader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/downloader.go)中找到这些接口。
## 上传器接口
目前,只实现了`GiteaLocalUploader`因此我们只能通过此Uploader将下载的数据保存到本地的Gitea实例。目前不支持其他上传器。
您可以在[uploader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/uploader.go)中找到这些接口。