Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/getting-started/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,4 @@ Please refer to [the documentation](/docs/development) for details.

## Design & Principle

Since Go is a static language, there is no friendly plugin mechanism. Instead of a dynamic approach, we use recompilation for deployment. Please refer to [the blog](/blog/2023/07/22/why-the-answer-plugin-system-was-designed-this-way) for details.
Since Go is a static language, there is no friendly plugin mechanism. Instead of a dynamic approach, we use recompilation for deployment. Please refer to [the blog](/blog/2023/07/22/why-the-answer-plugin-system-was-designed-this-way) for details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
sidebar_label: Blog Post
slug: /blog-post
---

# 贡献一篇博客文章

博客是[参与](/community/contributing#get-involved) Apache Answer 的最简单方法之一。这也是与他人分享你的知识和经验的好方法。

如果你用 Apache Answer 构建了自己的问答社区,或者 Apache Answer 帮助你解决了问题,我们很想听听你的故事。我们还鼓励你分享使用 Apache Answer 的技巧和窍门,或写下如何为项目做出贡献。

要开始,只需阅读我们的博客指南并开始写作!

## 存储库地址

- [GitHub](https://github.com/apache/incubator-answer-website): 撰写和存储博客文章。
- [Crowdin](https://crowdin.com/project/answer-website): 将博客文章翻译成多种语言,使更广泛的受众更容易访问。

## 博客目录

博客目前有两种语言版本:英语(默认)和中文。如果你要提交中文博客,你需要手动将其复制到 /blog 目录,以防止编译错误。如果你只提交英语博客,你不需要做其他任何事情。

- 英文博客: `/blog`
- 中文博客: `/i18n/docusaurus-plugin-content-blog`

我们与 Crowdin 集成,它会自动同步需要翻译的文件。这使得社区贡献者更容易参与翻译。

## 博客类别

我们当前的博客类别是:

- Community
- Best Practices
- Tutorials
- Insights
- Releases
- Tech

除了提交新博客外,还可以通过识别和纠正任何不正确或不清晰的语言,或更新内容以反映最新信息来帮助维护现有的博客内容。

## 提交博客

### 环境设置

项目预览和运行取决于 [node](https://nodejs.org) 和 [pnpm](https://pnpm.io) 。请提前安装好。

### 添加作者信息

所有作者信息都存储在以下文件中:

- `/blog/authors.yml`
- `/i18n/docusaurus-plugin-content-blog/authors.yml`

你可以在这些文件中添加有关自己的信息以显示。这里有一个例子:

```yaml title="/blog/authors.yml"
Anne:
name: Anne Zhu
title: Product Marketing Manager
url: https://github.com/PrimmaAnna
image_url: https://avatars.githubusercontent.com/u/131739771?v=4

# Use in the blog's frontMeta
---
authors: [Anne] # separate with commas [Anne, others]
---
```

### 过程

1. 确保将新的博客文档放在正确的路径上。

- **对于英语博客**: 在`/blog`目录中创建一个新的 Markdown 文件。
- **对于中文博客**: 在`/i18n/zh-CN/docusaurus-plugin-content-blog/`目录中创建一个新的 Markdown 文件。

2. 为了确保最终文章 URL 遵循`/blog/2023/06/01/hello-world`,我们为每个文章文件建立了以下命名约定:

- **纯文本**
- 在`/blog`目录中直接创建一个名为`2023-06-01-hello-world.md`的文件。
- **富文本**
- 在`/blog`目录中创建一个名为`/2023-06-01-foo-bar`的目录。
- 在`/2023-06-01-foo-bar`目录里创建一个`index.md`文件。
- 图像和其他多媒体内容也应放置在此目录中。

为了保持语义和独特的文章 URL ,我们建议在命名文件或文件夹时在日期后使用博客标题。将标题转换为小写,并将单词与连字符连接起来。这消除了对页面上的弹头字段的担忧。除非绝对必要,否则避免指定弹头字段。

例如,如果博客的标题是`Hello World`,该文件可以命名为`2023-06-01-hello-world`,这将生成 URL `/blog/2023-06-01/hello-world`。

```shell
blog
├── 2023-06-01-foo-bar # Use directory for images.
│ ├── index.md
│ ├── sample.png
│ └── ...
├── 2023-06-01-hello-world.md # Use file for plain text.
└── ...
```

为了确保跨平台的文件兼容性,避免在文件名中使用特殊字符`/ ? * : | \ < > & #`。

3. 在 [Docusaurus Markdown](https://docusaurus.io/docs/markdown-features) 中学习 Markdown 语法。如果包含图像,请确保图像和博客位于同一目录中。

除了标准元数据字段外,我们还引入了一些自定义字段及其用法,例如“封面图像”(图像)和“特色帖子”(特色)。

封面图像需要遵守我们的视觉风格指南,以便你可以专注于撰写博客文章。提交后,我们将根据你的内容自动生成封面图片。

“特色”字段决定你的博客文章是否出现在[博客](/blog)主页上。要突出你的博客文章,请将“特色”字段设置为“真实”。

查看以下示例。

```yaml
title: The What, Why Using Tags for Online Community
authors: [Anne]
category: Insights // value reference in blog type
featured: true
image: 2023-07-11-cover@4x.png // Note: place it in the /static/img/blog directory.
description: "Discover more about tags, benefits, and how vital they are for organizing content in online community."
```

4. 在提交代码之前,请确保运行无错误。你可以通过运行以下命令来检查它。

```shell
# Preview locally
pnpm start # to preview the Chinese docs, run pnpm start:zh)

# Locally compile to ensure no errors before submitting
pnpm build # no errors when display [SUCCESS] Generated static files in "build/zh-CN"
```

## 其他

对于代码提交,您可能还需要学习 [Git](https://git-scm.com/) 和[拉取请求](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)。
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
slug: /contributing
---

# 贡献

感谢你有兴趣为 Apache Answer 做出贡献,希望本文档能明确做出贡献的过程。

[开源指南网站](https://opensource.guide/)为想要学习如何运行开源项目并为其做出贡献的个人、社区和公司提供了资源集合。以下指南将会对贡献者和开源新手特别有用:

- [如何为开源做出贡献](https://opensource.guide/how-to-contribute/)
- [建立欢迎社区](https://opensource.guide/building-community/)

## 行为规范

Apache Answer 通过了一项行为准则,我们希望项目参与者遵守该准则。请阅读[全文](https://www.apache.org/foundation/policies/conduct.html),以便你了解哪些行动是可以容忍的,哪些是不能容忍的。

## 参与进来

Apache Answer 是一个由热情的用户、贡献者和PMC成员构建的开源项目。我们致力于创建一个开放和包容的社区,我们欢迎每个人加入我们,接收 Apache 的方式,共同构建开源。

任何人都可以为 Apache Answer 做出贡献。除了贡献代码外,还有许多其他参与方式,例如:

##### 使用 Apache Answer

- 开始使用Apache Answer很容易。只需遵循我们的[入门指南](/docs/installation),看看是否一切正常运行。
- 如果没有,你可以。[创建一个问题](/community/issues)来报告错误或提出改进建议。

##### 分类问题和拉取请求

- 如果你认为[问题](/community/issues)没有提供解决它所需的所有细节,请询问更多信息。
- 表明[标签](https://github.com/apache/incubator-answer/labels)有助于对问题进行分类。
- 标记过时或应该关闭的问题。
- 询问测试计划和审查代码。

##### 贡献代码

- 如果你找到可以解决的问题,请认领问题。创建一个[拉取请求](/community/pull-request)来提交你的更改。
- 标记为[`good first issue`](https://github.com/apache/incubator-answer/labels/good%20first%20issue)的问题非常适合作为开始。

##### 改进文档

- 如果你在阅读我们的[文档](/docs)时发现任何错别字、语法或错误,只需单击“编辑此页面”并在GitHub上进行编辑。

##### 开发插件

- 使用插件扩展 Apache Answer 的功能。
- 一些用户期待的功能,可以通过[开发和提交](/docs/development/plugins)去声明或创建你的需求。

##### 帮助版本发布

- 通过测试新的候选版本并在[dev@answer.apache.org](https://lists.apache.org/list.html?dev@answer.apache.org)上投票,帮助我们让 Apache Answer 变得更好。
- 如果你没有发现任何问题,可以投`+1 (non-binding)`赞成票。
- 如果你发现了问题,可以投 `-1 (non-binding)`反对票。

##### 贡献翻译

- 如果你能流利地使用英语以外的语言,你可以使用 [Crowdin](https://crowdin.com/project/answer) 帮助我们将 Apache Answer 翻译成其他语言。
- 想要获得更多信息,可以参阅[贡献翻译指南](/community/translation)。

##### 帮助支持

- 通过在 [Apache Answer Meta](https://meta.answer.dev)上帮助其他用户可以为我们提供很大的帮助。
- 回复并解决[邮箱列表](/community/support/#mailing-list)中的问题。

##### 推广 Apache Answer

- 在社交媒体上分享 Apache Answer 。
- 在 Apache Answer 上把你的故事分享给更多人。
- 加入我们的聚会、论坛等。

##### 其他

- 有新想法吗?非常欢迎所有贡献。
- - 如果你认为你需要帮助来规划你的贡献,请[联系我们](/community/support/#others),并告诉我们你正在寻找什么样的帮助。

## 开发过程

Apache Answer 使用[GitHub](https://github.com/apache/incubator-answer)作为其真实版本的来源。核心团队将直接在那里工作。所有的更改从一开始就会是公开的。

所有拉取请求都将由持续集成系统GitHub操作进行检查。有单元测试,还有更多。

### 分支组织

提交PR时应选择哪个分支?

- `main`分支对应于**最新版本**的 answer。如果你正在为最新版本**修复**问题,请选择主分支。
- `dev`分支用于**下一个版本**的开发。因此,如果你正在开发**新功能**,请切换到开发分支,并为其提交PR。

通常,我们在问题上标记里程碑来跟踪问题应该在哪个版本中修复。因此,你可以根据里程碑确定应该提交到哪个版本。
Loading