homepage/docs/zh-Hans/CONTRIBUTING.md
CDN 9ac43ef4f9
All checks were successful
Deploy / Deploy (push) Successful in 1m15s
feat: migrate language code
2025-02-03 22:52:56 +08:00

130 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 贡献指南
## 数据文件结构
### 1. 贡献者信息 (`data/[lang]/contributors.json`)
```json
{
"members": [
{
"name": "贡献者名称",
"role": "身份描述",
"avatar": "头像URL",
"links": [
{
"name": "链接名称",
"url": "链接地址",
"color": "文本颜色类名",
"icon": "图标名称"
}
],
"isCore": true/false // 是否为核心贡献者
}
]
}
```
### 2. 项目动态文章
动态文章按年份组织,存放在对应的 JSON 文件中。
`data/[lang]/updates.json` 中引用了对应年份的动态文章索引:
```json
{
"years": [
"index/2025.json",
"index/2024.json",
"index/2023.json",
"index/2022.json",
"index/2021.json",
"index/2020.json"
]
}
```
`data/[lang]/updates/index/[YYYY].json` 中包含了对应年份的动态列表:
```json
{
"updates": [
{
"id": "journal-2020q3", // 文章id会构成形如 `https://mirror.starset.fans/updates/journal-2020q3` 的 URL
"date": "2020-10-07", // 发布日期
"title": "2020年第三季度项目动态", // 文章标题
"summary": "在本季度中我们从一个bilibili账号“发展”成了一个有目标的项目这期间我们经历了网站迁移、财务账户独立、多个应用更新和社区管理调整并处理了一次安全攻击。", // 文章摘要
"tags": ["journal"] // 文章标签
}
]
}
```
如果有具体的文章内容,需要以 Markdown 格式存放与 `/data/[lang]/updates/[YYYY]/[id].md` 中。Markdown 文件只包含正文,不包含标题和目录。
### 3. 特色翻译 (`data/featured-translations.json`)
```json
{
"translations": [
{
"id": 编号,
"en": "英文原文",
"zh_CN": "简体中文翻译",
"zh_TW": "繁体中文翻译"
}
]
}
```
### 4. 站点翻译(`data/[lang]/index.json`
如果你的 Pull Request 涉及对站点组件的修改,请确保将使用的文字分离到上述翻译文件中,并在翻译文件的对应位置添加新的翻译。
## 如何贡献
### 更新贡献者信息
1. 找到 `data/[lang]/contributors.json` 文件
2. 按照上述 schema 格式添加或修改贡献者信息
3. 确保提供的所有 URL头像、链接等是可访问的
4. 提交 Pull Request
### 添加/修改更新文章
1.`data/[lang]/updates/[year]/` 目录下创建或找到对应月份的 JSON 文件
2. 按照上述 schema 格式添加或修改文章内容
3. 文章内容支持 Markdown 格式,可以包含:
- 标题(使用 #
- 链接
- 图片
- 列表
- 引用
- 代码块
4. 提交 Pull Request
### 添加/修改特色翻译
1. 编辑 `data/featured-translations.json` 文件
2. 按照上述 schema 格式添加或修改翻译内容
3. 确保提供所有语言版本的翻译
4. 提交 Pull Request
## 提交指南
1. Fork 本仓库
2. 创建你的特性分支 (`git checkout -b feature/AmazingFeature`)
3. 提交你的更改 (`git commit -m 'Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 开启一个 Pull Request
## 代码风格
- JSON 文件使用 2 空格缩进,不包含注释
- 文件名使用小写字母,多个单词用连字符(-)连接
- 日期格式YYYY-MM-DD
## 注意事项
1. 所有文本内容都需要遵循多语言格式,确保在所有语言目录下都有对应的翻译(除非提交的资源是针对特定语言)
2. 图片和其他媒体资源请上传到指定的图床,具体请联系项目维护者