Contributing
Contribute to Hello Dify
Contributing Examples
If you wish to contribute examples to this project, please follow these steps:
1. Fork the Project
2. Clone the Forked Project
After forking the project, copy the git link of your forked project, such as https://github.com/your-username/hello-dify.git
Open a terminal, navigate to the desired location, and clone the project using the following command:
3. Edit MDX Documents
We highly recommend using AI-assisted IDEs for document writing (such as Cursor, Windsurf, Cline, etc.).
Open a new window and select the directory to enter the project.
The project directory structure is as follows:
Each document directory follows these basic principles:
-
meta.{lang}.json
file: Controls the display order and structure of documents in the navigation menu, for example:This project uses RemixIcon for icons
-
Document files (
*.mdx
): Actual content, must include frontmatter (YAML information block at the top of the file), for example: -
Subdirectories: More specific content categories, each subdirectory needs its own
meta.{lang}.json
file
Document filenames follow the format document.{lang}.mdx
English documents: document.mdx
Chinese documents: document.zh.mdx
Japanese documents: document.ja.mdx
Internationalization (i18n)
You only need to write content in one language, and Cursor can help complete the rest.
This project has a built-in Cursor rule: .cursor/rules/i18n.mdc
You need to add i8n.mdc
using @
, the following prompt can be used as a reference:
The Cursor rule includes instructions on how to configure filenames and meta.{lang}.json
.
Images
This project controls domain whitelists through next.config.mjs
. Currently, sm.ms is allowed as the image hosting service for centralized image management.
If you use other image hosting solutions, please modify next.config.mjs
, but still follow the principle of unified storage.
We strongly recommend setting your language to English before taking screenshots, to make it easier for readers of different languages.
4. Testing
Before submitting, please complete local testing to ensure correct compilation. Here are the testing steps:
Install Dependencies
First, make sure all dependencies are installed:
Run Locally
Start the development server to check the result:
Visit http://localhost:3000
to check if your document displays correctly.
i18n Completeness Check
Important Note: Make sure to complete all language versions of the documents. By default, if you don't create English (.mdx
) files, documents in other languages will fail to compile.
Required files:
- English version (base version):
document.mdx
- Chinese version:
document.zh.mdx
- Japanese version:
document.ja.mdx
- Metadata files for each language:
meta.json
,meta.zh.json
,meta.ja.json
Check method:
- Run
yarn build
ornpm run build
to test the build - Observe if there are any compilation errors in the console
- Common errors include:
- Missing document in a particular language
- Frontmatter format errors
- Referencing non-existent documents in meta.json
- Broken image links
If you find compilation errors, please fix the issues based on the error messages before submitting.
Test All Language Versions
Switch between different languages to view the documents:
- English version:
http://localhost:3000/en/docs/...
- Chinese version:
http://localhost:3000/zh/docs/...
- Japanese version:
http://localhost:3000/ja/docs/...
Make sure all language versions display correctly and have consistent content.
5. Submission
In your IDE, click , click , and select Branch -> Create Branch:
Enter a branch name. If you only added documentation, you can call it docs/document-name
.
Click the button below, select the branch you just created, and complete the PR (Pull Request)
Submit Examples or Feedback
If you want to submit an example and would like us to help you complete the content, you can submit an Issue to this repository.
Issue format reference:
We will review your submitted Issue and create the corresponding document after acceptance. If you have any questions or need further discussion, please leave a comment in the Issue.