Skip to content

Commit b55998e

Browse files
Deploy NeoForge 26.1 tutorial website
0 parents  commit b55998e

160 files changed

Lines changed: 43975 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/deploy-pages.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
env:
22+
SITE_URL: ${{ vars.SITE_URL }}
23+
SITE_BASE_URL: ${{ vars.SITE_BASE_URL }}
24+
steps:
25+
- name: Check out repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 24
32+
cache: npm
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Build website
38+
run: npm run build
39+
40+
- name: Upload Pages artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: build
44+
45+
deploy:
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
runs-on: ubuntu-latest
50+
needs: build
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

‎.gitignore‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Dependencies
2+
/node_modules
3+
/.corepack
4+
5+
# Local reference material
6+
/official-docs
7+
/.skill-staging
8+
9+
# Production
10+
/build
11+
12+
# Generated files
13+
.docusaurus
14+
.cache-loader
15+
16+
# IDE
17+
/.idea
18+
19+
# Misc
20+
.DS_Store
21+
.env.local
22+
.env.development.local
23+
.env.test.local
24+
.env.production.local
25+
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*

‎AGENTS.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# NeoForge 26.1 教程
2+
3+
- 编写面向模组开发新手的中文 NeoForge 26.1 零基础开发教程。
4+
- 以知识讲解为主,代码只用于说明当前概念。
5+
- 内容务求简练,不写与当前操作或概念无直接关系、对读者帮助不大的文字。
6+
7+
## 项目结构
8+
9+
- `tutorial/README.md`:教程定位。
10+
- `tutorial/OUTLINE.md`:章节大纲草案,可按实际情况调整。
11+
- `official-docs/`:仅作本地参考资料,技术内容以 `official-docs/26.1/` 为准,旧版本文档用于差异参考;该目录不直接用于网站构建、翻译或正文生成,也不上传至 GitHub。
12+
- `docs/`:翻译的中文文档
13+
14+
## 教学工程
15+
16+
- `D:\folder\tutorialmod-template-26.1`:教学模组工程,可直接运行并用于教程示例和截图。
17+
18+
## 图片与像素源稿
19+
20+
- 所有生成的图片统一放在 `tutorial/generatedimages/` 下;每个任务的图片和对应像素源稿放在该目录内的同一子文件夹中,例如 `tutorial/generatedimages/<名称>/`。教学工程中的资源副本由该源稿生成。
21+
- 教程正文不展示或引用生成的示例贴图、示例材质及像素源稿;只说明读者需要准备的文件路径、尺寸和格式。素材与源稿是否放入正文由用户明确决定。
22+
23+
## 教程写作规范
24+
25+
- 正文通常直接进入当前主题,不写章节概述、目标清单或结尾总结。
26+
- 引入可替换示例时,首次写“以...为例”,说明哪些 ID、字段和名称可以替换。
27+
- 章节或步骤标题优先使用通用动作,例如“注册方块”“注册方块物品”,具体对象在正文中说明。
28+
- 已经教过,或读者自己会做的内容,后续只用一句提示读者在哪里新增或修改,不再重复展示操作过程。
29+
- 不写无意义或对教学没有帮助的内容和描述。
30+
- 通常按步骤逐段添加或修改代码,并解释新增片段的作用;不要直接要求读者复制整份文件。
31+
- 通常不用单独设置“运行并检查”章节。
32+
- 写作粒度参考 `tutorial/02-制作第一个物品.md`,但它不是技术依据。
33+
- 编写或修改教程正文时默认不执行站点构建;只有用户明确要求,或正在排查构建问题时才执行。
34+
- 上述规范是默认做法,应根据章节类型、内容难度和教学效果灵活调整。

‎README.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# NeoForge 26.1 文档网站
2+
3+
网站直接使用官方 NeoForged Documentation 的 Docusaurus 文档主题。
4+
5+
- 教程内容来自 `tutorial/`
6+
- 中文文档内容来自 `docs/`
7+
- 网页配置与主题位于项目根目录
8+
9+
双击 `启动网站.cmd` 可启动本地预览。网站会直接读取上述两个目录中的 Markdown 文件,不需要同步或复制文章。
10+
11+
## 部署到 GitHub Pages
12+
13+
1. 在 GitHub 新建一个空仓库,不要同时创建 README、许可证或 `.gitignore`。
14+
2. 打开仓库的 `Settings` → `Pages`,将 `Build and deployment` 的 `Source` 设为 `GitHub Actions`。
15+
3. 在项目根目录初始化并推送仓库:
16+
17+
```powershell
18+
git init -b main
19+
git add .
20+
git commit -m "Add NeoForge documentation website"
21+
git remote add origin https://github.com/<用户名>/<仓库名>.git
22+
git push -u origin main
23+
```
24+
25+
推送后,`.github/workflows/deploy-pages.yml` 会自动构建并发布网站。普通仓库的地址为 `https://<用户名>.github.io/<仓库名>/`;若仓库名为 `<用户名>.github.io`,地址为 `https://<用户名>.github.io/`。
26+
27+
绑定自定义域名时,在仓库的 `Settings` → `Secrets and variables` → `Actions` → `Variables` 中添加 `SITE_URL`(例如 `https://docs.example.com`)和 `SITE_BASE_URL`(值为 `/`),然后在 `Settings` → `Pages` 中填写同一个域名。

‎babel.config.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

‎docs/INDEX.md‎

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# NeoForge 26.1 官方文档中文参考目录
2+
3+
## Getting Started(入门)
4+
5+
- [NeoForge 入门](./gettingstarted/index.md)
6+
- [模组文件](./gettingstarted/modfiles.md)
7+
- [组织模组结构](./gettingstarted/structuring.md)
8+
- [版本管理](./gettingstarted/versioning.md)
9+
10+
## Concepts(核心概念)
11+
12+
- [注册表](./concepts/registries.md)
13+
- [客户端与服务端](./concepts/sides.md)
14+
- [事件](./concepts/events.md)
15+
16+
## Blocks(方块)
17+
18+
- [方块](./blocks/index.md)
19+
- [方块状态](./blocks/states.md)
20+
21+
## Items(物品)
22+
23+
- [交互](./items/interactions.md)
24+
- [数据组件](./items/datacomponents.md)
25+
- [消耗品](./items/consumables.md)
26+
- [工具](./items/tools.md)
27+
- [盔甲](./items/armor.md)
28+
- [生物效果与药水](./items/mobeffects.md)
29+
- [物品](./items/index.md)
30+
31+
## Entities(实体)
32+
33+
- [实体](./entities/index.md)
34+
- [数据与网络同步](./entities/data.md)
35+
- [生物实体、生物与玩家](./entities/livingentity.md)
36+
- [属性](./entities/attributes.md)
37+
- [实体渲染器](./entities/renderer.md)
38+
39+
## Block Entities(方块实体)
40+
41+
- [方块实体渲染器](./blockentities/ber.md)
42+
- [方块实体](./blockentities/index.md)
43+
44+
## Fluids(流体)
45+
46+
- [流体](./fluids/index.md)
47+
- [世界中的流体](./fluids/inworld.md)
48+
- [配方中的流体](./fluids/recipes.md)
49+
50+
## Resources(资源)
51+
52+
- [资源](./resources/index.md)
53+
54+
### Client Resources(客户端资源)
55+
56+
- [国际化与本地化](./resources/client/i18n.md)
57+
- [模型数据生成](./resources/client/models/datagen.md)
58+
- [模型](./resources/client/models/index.md)
59+
- [客户端物品](./resources/client/models/items.md)
60+
- [自定义模型加载器](./resources/client/models/modelloaders.md)
61+
- [理解模型系统](./resources/client/models/modelsystem.md)
62+
- [粒子](./resources/client/particles.md)
63+
- [声音](./resources/client/sounds.md)
64+
- [纹理](./resources/client/textures.md)
65+
66+
### Server Resources(服务端资源)
67+
68+
- [进度](./resources/server/advancements.md)
69+
- [数据加载条件](./resources/server/conditions.md)
70+
- [伤害类型与伤害来源](./resources/server/damagetypes.md)
71+
- [内置数据映射](./resources/server/datamaps/builtin.md)
72+
- [数据映射](./resources/server/datamaps/index.md)
73+
- [内置魔咒效果组件](./resources/server/enchantments/builtin.md)
74+
- [魔咒](./resources/server/enchantments/index.md)
75+
- [自定义战利品对象](./resources/server/loottables/custom.md)
76+
- [全局战利品修改器](./resources/server/loottables/glm.md)
77+
- [战利品表](./resources/server/loottables/index.md)
78+
- [战利品条件](./resources/server/loottables/lootconditions.md)
79+
- [战利品函数](./resources/server/loottables/lootfunctions.md)
80+
- [内置配方类型](./resources/server/recipes/builtin.md)
81+
- [自定义配方](./resources/server/recipes/custom.md)
82+
- [配方](./resources/server/recipes/index.md)
83+
- [原料](./resources/server/recipes/ingredients.md)
84+
- [标签](./resources/server/tags.md)
85+
86+
- [资源元数据](./resources/metadata.md)
87+
- [重载监听器](./resources/reloadlisteners.md)
88+
89+
## Inventories & Transfers(物品栏与传输)
90+
91+
- [容器](./inventories/container.md)
92+
- [能力](./inventories/capabilities.md)
93+
- [菜单](./inventories/menus.md)
94+
- [事务](./inventories/transactions.md)
95+
96+
## Data Storage(数据存储)
97+
98+
- [命名二进制标签(NBT)](./datastorage/nbt.md)
99+
- [Codec](./datastorage/codecs.md)
100+
- [值 I/O](./datastorage/valueio.md)
101+
- [数据附件](./datastorage/attachments.md)
102+
- [保存数据(Saved Data)](./datastorage/saveddata.md)
103+
104+
## Worldgen(世界生成)
105+
106+
- [生物群系修改器](./worldgen/biomemodifier.md)
107+
108+
## Networking(网络)
109+
110+
- [注册载荷](./networking/payload.md)
111+
- [流编解码器](./networking/streamcodecs.md)
112+
- [配置任务](./networking/configuration-tasks.md)
113+
- [网络](./networking/index.md)
114+
115+
## Rendering(渲染)
116+
117+
- [渲染特性](./rendering/feature.md)
118+
- [客户端粒子](./rendering/particles.md)
119+
- [屏幕](./rendering/screens.md)
120+
121+
## Advanced Topics(高级主题)
122+
123+
- [访问转换器](./advanced/accesstransformers.md)
124+
- [可扩展枚举](./advanced/extensibleenums.md)
125+
- [功能标志](./advanced/featureflags.md)
126+
127+
## Miscellaneous(其他主题)
128+
129+
- [命令](./misc/commands.md)
130+
- [配置](./misc/config.md)
131+
- [调试分析器](./misc/debugprofiler.md)
132+
- [游戏测试](./misc/gametest.md)
133+
- [标识符](./misc/identifier.md)
134+
- [按键映射](./misc/keymappings.md)
135+
- [NeoForge 更新检查器](./misc/updatechecker.md)

‎docs/README.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# NeoForge 26.1 官方开发文档(中文参考)
2+
3+
本目录是 `official-docs/26.1/` 的简体中文参考译文。译文尽量保留原文的章节结构、文件名、代码、标识符和相对链接,以便与英文原文对照阅读。
4+
5+
已翻译分类(按原版侧边栏顺序):
6+
7+
- [Getting Started(入门)](./gettingstarted/index.md)
8+
- [Concepts(核心概念)](./concepts/registries.md)
9+
- [Blocks(方块)](./blocks/index.md)
10+
- [Items(物品)](./items/index.md)
11+
- [Entities(实体)](./entities/index.md)
12+
- [Block Entities(方块实体)](./blockentities/index.md)
13+
- [Fluids(流体)](./fluids/index.md)
14+
- [Resources(资源)](./resources/index.md)
15+
- [Inventories & Transfers(物品栏与传输)](./inventories/container.md)
16+
- [Data Storage(数据存储)](./datastorage/nbt.md)
17+
- [Worldgen(世界生成)](./worldgen/biomemodifier.md)
18+
- [Networking(网络)](./networking/index.md)
19+
- [Rendering(渲染)](./rendering/feature.md)
20+
- [Advanced Topics(高级主题)](./advanced/accesstransformers.md)
21+
- [Miscellaneous(其他主题)](./misc/commands.md)
22+
23+
译文基于 `official-docs/26.1/` 的 2026-11-13 本地快照,对应官方仓库提交 `4a680cdd4d15013b65fd84998d1f4cd7e2885ae5`。原文中的示例版本号会原样保留,因此部分字段示例可能沿用旧版本;实际配置应以 26.1 的 MDK、英文原文和所选 NeoForge 构建为准。
24+
25+
译文仅用于阅读参考。技术细节、API 名称和原始表述发生歧义时,请以对应的英文原文、固定 NeoForge 构建和实际编译结果为准。

‎docs/advanced/_category_.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "高级主题",
3+
"position": 14
4+
}

0 commit comments

Comments
 (0)