Skip to content

Commit

Permalink
Add contribute community blog post (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenbox authored Nov 30, 2023
1 parent 7e345b9 commit 8894c27
Show file tree
Hide file tree
Showing 18 changed files with 167 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Why Open Source is the Essence of Answer
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: Take a nibble on open source, examples, and why it's the essence of Answer.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Everything You Need to Know About Answer
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: "Find out everything about Answer: our motivation, why it’s open-source, the people behind it, etc."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Celebrate Answer’s First Anniversary with Hacktoberfest 2023
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: "Answer will be part of Hacktoberfest 2023, a month-long celebration of open-source power. Here’s everything you need to know to join Answer’s event."
Expand Down
2 changes: 1 addition & 1 deletion blog/2023-10-24-answer-enters-apache-incubator/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Answer Enters Apache Incubator
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: "On October 9th, the knowledge-based Q&A software Answer, developed by SegmentFault team under ONES.com, passed the vote and was accepted to the Apache Software Foundation (ASF) Incubator. "
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Answer Turns 1, and is Now Apache Answer
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: "Celebrate Answer’s first anniversary with a wrap-up, and stay tuned for new features coming next year. "
Expand Down Expand Up @@ -45,4 +45,4 @@ Working with the community that consists of a group of product users, lovers, an

We’re always open for feedback and advice, so please let us know if you’re coming up with something, on [Twitter](https://twitter.com/AnswerDev), [Discord](https://discord.gg/c537sFxu), or [Meta Answer](https://meta.answer.dev/). If you loved to join our Apache journey, check on our repository [here](https://github.com/apache/incubator-answer).

Shout out to everyone, and thanks for making the past year a lovely memory. Stay tuned, and there will be new stuff coming.
Shout out to everyone, and thanks for making the past year a lovely memory. Stay tuned, and there will be new stuff coming.
132 changes: 132 additions & 0 deletions community/contributing/blog-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
sidebar_label: Blog Post
slug: /blog-post
---

# Contribute a Blog Post

Blogs are one of the easiest ways to [get involved](/community/contributing#get-involved) in Apache Answer. It is also a great way to share your knowledge and experience with others.

If you've used Answer to build your own Q&A community, or if Answer has helped you solve a problem, we'd love to hear your story. We also encourage you to share tips and tricks for using Answer, or to write about how to contribute to the project.

To get started, just read our blog guidelines and get writing!

## Repository address

- [GitHub](https://github.com/apache/incubator-answer-website): Write and store blog posts.
- [Crowdin](https://crowdin.com/project/answer-website): Translate blog posts into multiple languages to make them more accessible to a wider audience.

## Blog directory

Blogs are currently available in two languages: English (default) and Chinese. If you're submitting a Chinese blog, you need to manually copy it to the /blog directory to prevent compilation errors. If you're only submitting English blogs, you don't need to do anything else.

- English blogs: `/blog`
- Chinese blogs: `/i18n/docusaurus-plugin-content-blog`

We've integrated with Crowdin, which automatically syncs files that need to be translated. This makes it easier for community contributors to get involved in the translation.

## Blog categories

Our current blog categories are:

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

Besides submitting a new blog, you can also help maintain existing blog content by identifying and correcting any incorrect or unclear language, or updating the content to reflect the latest information.

## Submit a blog

### Environment setup

The project preview and run depend on [node](https://nodejs.org) and [pnpm](https://pnpm.io). Please install them in advance.

### Add author information

All author information is stored in the following files:

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

You can add information to display about yourself in these files. Here’s an example:

```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]
---
```

### Process

1. Make sure to put the new blog documents in the correct path.

- **For English blog**: Create a new Markdown file in the `/blog` directory.
- **For Chinese blog**: Create a new Markdown file in the `/i18n/zh-CN/docusaurus-plugin-content-blog/` directory.

2. To ensure that the final article URL follows a format like `/blog/2023/06/01/hello-world`, we've established the following naming convention for each article file:

- **Plain Text**
- Directly create a file named `2023-06-01-hello-world.md` in the `/blog` directory.
- **Rich Text**
- Create a directory named `/2023-06-01-foo-bar` in the `/blog` directory.
- Create an `index.md` file inside the `/2023-06-01-foo-bar` directory.
- Images and other multimedia content should also be placed within this directory.

To maintain semantic and unique article URLs, we recommend using the blog's title after the date when naming files or folders. Convert the title to lowercase and connect the words with hyphens. This eliminates the need to worry about the slug field on the page. Avoid specifying the slug field unless it's absolutely necessary.

For instance, if the blog's title is `Hello World`, the file can be named `2023-06-01-hello-world` This will generate the 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.
└── ...
```

To ensure file compatibility across platforms, please avoid using special characters `/ ? * : | \ < > & #` in file names.

3. Learn Markdown syntax in [Docusaurus Markdown](https://docusaurus.io/docs/markdown-features). If images are included, make sure the images and the blog are in the same directory .

Apart from the standard metadata fields, we've also introduced some custom fields and their usage, such as "cover image" (image) and "featured post" (Featured).
The cover image needs to adhere to our visual style guidelines, so you can focus on writing your blog post. Once submitted, we'll automatically generate a cover image based on your content.

The "featured" field determines whether your blog post appears on the [Blog](/blog) homepage. To have your blog post featured, set the "featured" field to "true".

Check the example below.

```yaml
title: The What, Why Using Tags for Online Community
authors: [Anne]
category: Insights // value reference in blog type
featured: true
image: [email protected] // 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. Before submitting your code, please ensure that it runs error-free. You can check it by running the following commands.

```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"
```

## Others

For code submitting, you may also need to learn [Git](https://git-scm.com/) and [Pull Request](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).
16 changes: 8 additions & 8 deletions community/contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ slug: /development
2. After cloning the repository, run the following command. This will install all dependencies as well as build all local packages.

```shell
$ cd ./ui
$ pnpm install
cd ./ui
pnpm install
```

3. To start a development server, run `pnpm start`. now, your browser should already open automatically, and autoload `http://localhost:3000`. you can also manually visit it.
Expand All @@ -25,7 +25,6 @@ slug: /development
- We do have Prettier (a formatter) and ESLint (a syntax linter) to catch most stylistic problems. If you are working locally, you can run `pnpm lint` and `pnpm prettier` to fix most code formatting.
- **No runtime errors** Before submitting the code, please ensure that there will be no errors when running locally. This will greatly reduce the workload of review.


## Backend

### Installation
Expand All @@ -34,17 +33,18 @@ slug: /development
2. After cloning the repository, run the following command for build.

```shell
$ go mod download
$ go run cmd/answer/main.go init -C ./answer-data
go mod download
go run cmd/answer/main.go init -C ./answer-data
```

3. Visit `http://localhost/` to see the installation page and complete the installation.
3. Visit `http://localhost` to see the installation page and complete the installation.

4. Run the following command to start the server.

```shell
$ go run cmd/answer/main.go run -C ./answer-data
go run cmd/answer/main.go run -C ./answer-data
```

### Code conventions

We recommend that you follow [uber's Golang Guidelines](https://github.com/uber-go/guide) code style.
We recommend that you follow [uber's Golang Guidelines](https://github.com/uber-go/guide) code style.
2 changes: 1 addition & 1 deletion community/contributing/plugins.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_label: Plugins
# sidebar_label: Plugins
slug: /plugins
---

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/development/plugins.md → docs/guides/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: /plugins
---

# Plugins
# Using Plugins

:::tip

Expand Down
4 changes: 2 additions & 2 deletions i18n/zh-CN/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"Best Practice": {
"message": "最佳实践"
},
"Company": {
"message": "公司新闻"
"Community": {
"message": "社区新闻"
},
"Insights": {
"message": "深度洞察"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Why Open Source is the Essence of Answer
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: Take a nibble on open source, examples, and why it's the essence of Answer.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Everything You Need to Know About Answer
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: "Find out everything about Answer: our motivation, why it’s open-source, the people behind it, etc."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Celebrate Answer’s First Anniversary with Hacktoberfest 2023
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: "Answer will be part of Hacktoberfest 2023, a month-long celebration of open-source power. Here’s everything you need to know to join Answer’s event."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Answer Enters Apache Incubator
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: "On October 9th, the knowledge-based Q&A software Answer, developed by SegmentFault team under ONES.com, passed the vote and was accepted to the Apache Software Foundation (ASF) Incubator. "
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Answer Turns 1, and is Now Apache Answer
authors: [Anne]
category: Company
category: Community
featured: true
image: [email protected]
description: "Celebrate Answer’s first anniversary with a wrap-up, and stay tuned for new features coming next year. "
Expand Down Expand Up @@ -45,4 +45,4 @@ Working with the community that consists of a group of product users, lovers, an

We’re always open for feedback and advice, so please let us know if you’re coming up with something, on [Twitter](https://twitter.com/AnswerDev), [Discord](https://discord.gg/c537sFxu), or [Meta Answer](https://meta.answer.dev/). If you loved to join our Apache journey, check on our repository [here](https://github.com/apache/incubator-answer).

Shout out to everyone, and thanks for making the past year a lovely memory. Stay tuned, and there will be new stuff coming.
Shout out to everyone, and thanks for making the past year a lovely memory. Stay tuned, and there will be new stuff coming.
13 changes: 10 additions & 3 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,30 @@ module.exports = {
'getting-started/upgrade',
'getting-started/command-line',
'getting-started/configfile',
'getting-started/database',
'getting-started/env',
],
},
{
type: 'category',
label: 'Guides',
label: 'User Guides',
collapsed: true,
items: [
'guides/plugins',
'guides/permission',
'guides/reputation',
'guides/flags',
'guides/moderation',
'guides/settings',
],
},
'development/plugins',
{
type: 'category',
label: 'Developer Guides',
collapsed: true,
items: [
'development/database',
],
},
'notice',
'faq',
],
Expand Down
1 change: 1 addition & 0 deletions sidebarsCommunity.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = {
],
},
'contributing/translation',
'contributing/blog-post',
'contributing/how-to-release',
],
},
Expand Down

0 comments on commit 8894c27

Please sign in to comment.