- 克隆本仓库
- 安装依赖
pnpm install
- 启动本地环境
pnpm start
pnpm build && pnpm serve
master
分支上的代码会被自动编译部署到生产环境。
参看 GitHub Action 定义 查看部署流程的细节
如果您有任何问题,您可以创建一个 issue 或联系 contact@coscene.io
- 文件和文件夹的命名请按照文件会在侧边导航栏出现的顺序命名,例如在侧边栏第四个出现的【操作指南】模块的对应文件夹,就会
被命名为
4-recipes
,文件名也是类似,在4-recipes
中第 2 个出现的具体内容,就会被命名为2-projects.md
- 素材的命名遵循每个【大类】一个
img
文件夹的大致原则,在需要时,可以在更小的文件夹层级中建立img
文件夹。这样的好处 是方便调整文档位置,替换国际化等等。素材以所在的 Section 和 Sub-Section 的标号作为前缀,以实际的素材作用作为名称,比 如在第四个 Section,操作指南中的第三个 Sub-Section 设备操作中的图片名字,就应该以4-3-具体意义.png
作为命名,方便 后续的素材管理。
- 在 /docs 文件夹中编写中文(zh)文档
- 将文档复制到 i18n/en/docusaurus-plugin-content-docs/current 中并进行适当翻译。
- 其他页面、模板和组件,请参考 docusaurus 的 i18n 指南
docusaurus-plugin-content-docs
插件是按版本划分内容的。./docs
文件夹中的数据将在当前子文件夹和 current.json
文件中翻译。
在章节/类别转换时导航按钮的翻译有问题,这是一个官方已经在解决的问题了。
- Install dependencies.
pnpm install
- Run dev server.
pnpm start
pnpm build && pnpm serve
Push the changes to the master
branch. And the GitHub action will automatically try to build and deploy
the content to https://docs.coscene.cn
See the action file for details.
If you have any questions, fill free to open an issue or reach out to contact@coscene.io
-
Name files and folders according to their order in the sidebar navigation. For example, if the "Operation Guide" module appears fourth in the sidebar, its corresponding folder would be named
4-recipes
. Similarly, for file names, if a specific content appears second within4-recipes
, it would be named2-projects.md
. -
For naming assets, follow the general principle of having one
img
folder for each major category. When necessary, you can createimg
folders at smaller folder levels. This approach makes it easier to adjust document positions, replace internationalized content, etc. Assets should be prefixed with the numbers of their Section and Sub-Section, followed by a name describing their specific purpose. For instance, an image in the fourth Section (Operation Guide) and third Sub-Section (Device Operation) should be named like4-3-specific-purpose.png
, facilitating future asset management.
TL;DR Write the original document in the /docs
folder, copy it to i18n/en/docusaurus-plugin-content-docs/current
and do the proper translation.
Other pages, templates, and components, please refer to docusaurus's i18n guide
The docusaurus-plugin-content-docs
plugin always divides its content by versions. The data in ./docs
folder will be translated in the current subfolder and current.json
file.
There's a bug that prevents the translation of the nav button from showing up correctly when transitioning between chapters/categories. The official team is still working on this issue: