Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
f319cb4
Update PrismMac.js
RHZHZ Feb 9, 2026
567f379
Update PrismMac.js
RHZHZ Feb 9, 2026
2fed028
Update prism-mac-style.css
RHZHZ Feb 9, 2026
001f417
Update blog.config.js
RHZHZ Feb 9, 2026
c7db7c7
feat: claude theme changes without global entrypoint edits
HiderX Feb 16, 2026
74723ee
chore: add additive global deps and env hints for claude store
HiderX Feb 16, 2026
c290a34
fix: 尝试修复rss页404报错
lyizhuo Feb 18, 2026
6bc8146
Merge branch 'tangly1024:main' into fix-rss
lyizhuo Feb 18, 2026
ca6a585
fix(sitemap): skip external slugs and guard invalid dates
qianzhu18 Feb 21, 2026
cbe4d6d
fix(proxio): keep default nav when custom menu is empty
qianzhu18 Feb 21, 2026
c9a2313
Resolve site cover priority
yunhe-dev Feb 27, 2026
b32a6bf
Merge branch 'main' into contrib/fix-proxio-empty-custom-menu
qianzhu18 Mar 9, 2026
9e0ccbe
fix: stabilize flip card hover behavior
88lin Mar 26, 2026
944387e
fix: 优化 export 预热阶段的跨进程并发协调逻辑
88lin Apr 14, 2026
1192c60
Merge branch 'tangly1024:main' into fix-export-prefetch-lock
88lin Apr 22, 2026
a17a52f
Fix TOC parsing for newer Notion heading types.
Apr 28, 2026
bc90e63
chore: bump version to 4.9.4.3
Apr 28, 2026
048dd7b
Merge pull request #3946 from tangly1024/fix/toc-heading-indent-crash
tangly1024 Apr 28, 2026
147e057
fix(proxio): dropdown menu overlap and blur behavior (#3937)
ProcessMonitor Apr 28, 2026
2e84f05
Merge branch 'main' into fix-export-prefetch-lock
tangly1024 Apr 29, 2026
c107786
Merge pull request #3919 from 88lin/fix-export-prefetch-lock
tangly1024 Apr 29, 2026
68e3ffb
security: pin form-data resolution to ^4.0.4
YesYouKenSpace Apr 29, 2026
4086c99
Merge pull request #3952 from tangly1024/chore/security-form-data-res…
tangly1024 Apr 29, 2026
7a94ccd
Fix Notion data source schema parsing and page list merging.
such-xl Apr 29, 2026
7d30537
Merge pull request #3953 from tangly1024/fix/notion-collectionid-fall…
tangly1024 Apr 29, 2026
551fe43
Merge branch 'main' into fix-stabilize-flip-card-hover-behavior
tanglyqq Apr 29, 2026
ec80c5f
Merge pull request #3871 from 88lin/fix-stabilize-flip-card-hover-beh…
tanglyqq Apr 29, 2026
83f640c
fix(notion): open article links in new tabs
qianzhu18 Mar 16, 2026
4bb9dff
fix(notion): only force new tabs for cross-origin links
Apr 29, 2026
9691cec
Merge pull request #3954 from tangly1024/fix/notion-link-new-tab-beha…
tangly1024 Apr 29, 2026
d0cb25e
Add Next.js plugin to Netlify configuration
HotelEnglish Feb 22, 2026
deb6914
Add build configuration for Netlify deployment
HotelEnglish Feb 22, 2026
1518cc3
Add @netlify/plugin-nextjs dependency
HotelEnglish Feb 22, 2026
689d27f
Update @netlify/plugin-nextjs to version 5.15.8
HotelEnglish Feb 22, 2026
fcdbc9d
Merge pull request #3955 from tangly1024/chore/netlify-deploy-compat
tangly1024 Apr 29, 2026
3a653fd
为 NotionNext 添加 TechGrow 接口
yunhe-dev Feb 26, 2026
7db7c3e
Fix TechGrow config bug
yunhe-dev Feb 26, 2026
bf59141
Document TechGrow readmore handling
yunhe-dev Feb 26, 2026
0b8d41c
Fix TechGrow readmore positioning
yunhe-dev Feb 26, 2026
7edf6f3
Fix TechGrow readmore validation
yunhe-dev Feb 26, 2026
67b95bb
Fix TechGrow captcha validation
yunhe-dev Feb 27, 2026
91a848d
docs: add TechGrow config hints for Notion Config page
yunhe-dev Feb 27, 2026
7a8ac7a
fix(techgrow): lock-aware init and exact list matching
Apr 29, 2026
6f1d3d7
chore(techgrow): move config to sub file
Apr 29, 2026
a51f7d5
docs(techgrow): refine subconfig comments
Apr 29, 2026
3b900af
Merge pull request #3956 from tangly1024/fix/techgrow-readmore-compat-v2
tangly1024 Apr 29, 2026
7783498
feat(top-tag): add global pinned-post ordering in data layer
Apr 29, 2026
d16971e
Merge pull request #3959 from tangly1024/feat/global-top-tag
tangly1024 Apr 29, 2026
7e11566
docs: add contributor onboarding and architecture docs
Apr 29, 2026
48e79a2
chore: bump version to 4.9.4.4
Apr 29, 2026
6c5e6f6
Merge pull request #3960 from tangly1024/docs/contrib-guides-v4.9.4.4
tangly1024 Apr 29, 2026
616e3ac
feat(fuwari): finalize theme migration and bump to v4.9.5.0
Apr 29, 2026
d609e29
Merge pull request #3961 from tangly1024/feat/theme-fuwari
tangly1024 Apr 29, 2026
5af7bc9
fix(fuwari): align mobile header and enable palette button
Apr 29, 2026
5e9f9f9
fix(fuwari): add mobile floating toc drawer
Apr 29, 2026
b6c4fd5
Merge pull request #3962 from tangly1024/feat/theme-fuwari
tangly1024 Apr 29, 2026
9a3a40c
fix(fuwari): restore submenu behavior and preserve route query on arc…
Apr 29, 2026
408e36c
Merge pull request #3963 from tangly1024/feat/theme-fuwari
tangly1024 Apr 29, 2026
a0b761d
Merge branch 'main' into claude-theme-additive-global
tangly1024 Apr 30, 2026
08b3a41
fix(fuwari): improve palette interaction and sidebar i18n
Apr 30, 2026
efcc31a
fix(fuwari): improve palette interaction and sidebar i18n
Apr 30, 2026
55562ee
Merge pull request #3964 from tangly1024/fix/fuwari-followup-pr
tangly1024 Apr 30, 2026
76fe21f
Initial plan
Copilot Apr 30, 2026
5f54cb7
Initial plan
Copilot Apr 30, 2026
f9c01f7
Add automated issue response GitHub Actions workflow
Copilot Apr 30, 2026
4f83d84
Fix consistency between immediate response and daily triage job messages
Copilot Apr 30, 2026
34e80eb
Fix Giscus: add data-category, data-strict, crossOrigin attributes an…
Copilot Apr 30, 2026
9fc2d28
Merge branch 'main' into claude-theme-additive-global
tangly1024 Apr 30, 2026
f2c0642
fix(techgrow): scope readmore to article and normalize fuwari modal o…
Apr 30, 2026
9903f3a
Merge pull request #3967 from tangly1024/feat/theme-fuwari
tangly1024 Apr 30, 2026
6191439
Merge branch 'main' into copilot/process-issues-analysis-response
tangly1024 Apr 30, 2026
f45c5ca
Merge pull request #3965 from tangly1024/copilot/process-issues-analy…
tangly1024 Apr 30, 2026
545bc0e
chore(gitignore): ignore local .tmp workspace artifacts
Apr 30, 2026
f1e318f
Merge branch 'main' into copilot/discuss-and-reply-in-github
tangly1024 Apr 30, 2026
dd7c329
Merge pull request #3966 from tangly1024/copilot/discuss-and-reply-in…
tangly1024 Apr 30, 2026
a11b874
Merge branch 'main' into chore/gitignore-tmp-dir
tangly1024 Apr 30, 2026
6dfbdd1
Merge pull request #3968 from tangly1024/chore/gitignore-tmp-dir
tangly1024 Apr 30, 2026
28b71d4
chore(fuwari): commit remaining config and comment UX updates
Apr 30, 2026
1046adc
Merge pull request #3969 from tangly1024/chore/backfill-dev-cache-and…
tangly1024 Apr 30, 2026
49fcf62
fix(seo): remove missing local font preload
Apr 30, 2026
b9f52ef
Merge pull request #3970 from tangly1024/fix/seo-remove-missing-font-…
tangly1024 Apr 30, 2026
1c046af
fix(fuwari): decrypt contact email on social button click
Apr 30, 2026
0e2e885
Merge pull request #3971 from tangly1024/fix/seo-remove-missing-font-…
tangly1024 Apr 30, 2026
bee6cf9
fix(prism): scope article queries to post content container
Apr 30, 2026
bd02ebb
fix(fuwari): simplify contact flip card copy and structure
Apr 30, 2026
6774d28
Merge pull request #3972 from tangly1024/fix/fuwari-prism-contact-fol…
tangly1024 Apr 30, 2026
1381f48
fix(prism,gitbook): improve mermaid lifecycle and dark mode consistency
Apr 30, 2026
a927756
Merge pull request #3973 from tangly1024/fix/prism-gitbook-followup-v2
tangly1024 Apr 30, 2026
ab581ee
Merge branch 'origin/main' into codex/fix-home-cover-from-page-cover
Apr 30, 2026
4489272
Merge pull request #3825 from yunhe-dev/codex/fix-home-cover-from-pag…
tangly1024 Apr 30, 2026
eef0cac
Merge branch 'main' into contrib/fix-proxio-empty-custom-menu
tangly1024 Apr 30, 2026
53afad0
Merge pull request #3807 from qianzhu18/contrib/fix-proxio-empty-cust…
tangly1024 Apr 30, 2026
0712344
Merge branch 'origin/main' into contrib/fix-sitemap-external-slug
Apr 30, 2026
d3e02fb
Merge pull request #3806 from qianzhu18/contrib/fix-sitemap-external-…
tangly1024 Apr 30, 2026
4df2edc
test(rss): cover block map compatibility adaptation
Apr 30, 2026
19349c0
Merge branch 'main' into fix-rss
tangly1024 Apr 30, 2026
0b15b08
Merge pull request #3804 from lyizhuo/fix-rss
tangly1024 Apr 30, 2026
a4e8bc0
Merge branch 'main' into claude-theme-additive-global
tangly1024 Apr 30, 2026
d278ede
fix(claude): address menu/rss runtime and scroll-spy stability
Apr 30, 2026
aad2d47
fix(claude): harden contribution pipeline and reorganize theme docs
Apr 30, 2026
1359d35
chore(gitignore): ignore test-results artifacts
Apr 30, 2026
c053ef5
Merge pull request #3789 from HiderX/claude-theme-additive-global
tangly1024 Apr 30, 2026
e160041
chore(theme-preview): add claude preview image
Apr 30, 2026
a149029
chore(release): bump version to 4.9.5.1
Apr 30, 2026
15cad20
Merge pull request #3975 from tangly1024/release/4.9.5.1
tangly1024 Apr 30, 2026
3e25c47
Merge pull request #3974 from tangly1024/chore/claude-theme-preview-i…
tangly1024 Apr 30, 2026
ae5d27d
chore(ci): align Yarn version for Cloudflare builds
tanglyqq Apr 30, 2026
9c4bcc3
Merge pull request #3976 from tangly1024/chore/cloudflare-yarn1-compat
tangly1024 Apr 30, 2026
bcfe88a
chore(ci): standardize Yarn-first collaboration workflow
tanglyqq May 1, 2026
7fdb3e5
Merge pull request #3979 from tangly1024/chore/yarn-workflow-docs
tangly1024 May 1, 2026
840a6d1
chore(config): tune Node engine range and guidance
tanglyqq May 1, 2026
627b7c6
chore(assets): update landing theme preview image
tanglyqq May 1, 2026
f32e41e
Merge pull request #3980 from tangly1024/chore/root-config-sanity-pass
tangly1024 May 1, 2026
ef0d8eb
fix(code-collapse): avoid long-code truncation and align defaults
tanglyqq May 1, 2026
dfda445
refactor(config): move collapse threshold into code config
tanglyqq May 1, 2026
4568484
Merge pull request #3767 from RHZHZ/smart-code-collapse
tangly1024 May 1, 2026
d3953f3
chore(theme): improve resolver diagnostics and validation
tanglyqq May 1, 2026
4abac37
perf(core): speed up build/runtime hot paths
tanglyqq May 1, 2026
3bf5943
perf(assets): slim share bundle and optimize theme previews
tanglyqq May 1, 2026
af35c17
fix(runtime): stabilize theme navigation and render behavior
tanglyqq May 1, 2026
3921ea8
perf(cpu): reduce unnecessary notion render observers
tanglyqq May 1, 2026
eead89c
fix(ui): clean runtime warnings and add theme audit command
tanglyqq May 1, 2026
e513b30
perf(audit): add production theme benchmark baseline
tanglyqq May 1, 2026
678d409
docs(dev): bump version and document all package scripts
tanglyqq May 1, 2026
25001a6
docs(contrib): add Chinese contribution entry and bilingual nav links
tanglyqq May 1, 2026
6b3fd30
Merge pull request #3981 from tangly1024/chore/perf-audit-issues-base…
tangly1024 May 1, 2026
46e305b
fix(fuwari): center post cards on mobile and prevent horizontal overflow
tangly1024 May 2, 2026
75c6bf1
Merge pull request #3982 from tangly1024/fix/fuwari-mobile-post-list-…
tangly1024 May 2, 2026
4f2e7ab
feat: Fuwari theme polish + reliable theme loading + dev UX
tangly1024 May 2, 2026
256b2e8
Merge pull request #3985 from tangly1024/feat/fuwari-theme-and-dev-im…
tangly1024 May 2, 2026
a26e97a
feat(themes): Claude and Fuwari nested nav (subMenus/children)
tangly1024 May 2, 2026
a0b7774
Merge branch 'main' into feat/fuwari-theme-and-dev-improvements
tangly1024 May 2, 2026
725d0c4
Merge pull request #3986 from tangly1024/feat/fuwari-theme-and-dev-im…
tangly1024 May 2, 2026
3441898
fix: sitemap 外链与生成规则
ArkURL May 2, 2026
f6c4de4
chore: remove unused JumpToTopButton components
LooseLi May 2, 2026
6b5093f
feat(支持配置LATEST_POST_COUNT): (#3122)
qixing-jk May 2, 2026
12eb73c
增加控制heo主题右侧英雄区遮罩图片显示与否的变量。 (#3547)
BolynWang May 2, 2026
83cdaf8
fix: prevent article render crash (PrismMac / insertBefore)
zhiqing0205 May 2, 2026
c1e7cf5
docs: Fork 更新指南与 scripts/update.sh 自动化脚本
dongzhenye May 2, 2026
57bcf73
feat: Notion 文章自定义版权声明(多主题)
qixing-jk May 2, 2026
99c5df8
feat(theme): add endspace theme (#3995)
tangly1024 May 3, 2026
bf47dcd
docs(endspace): credit original theme author (#4002)
tangly1024 May 3, 2026
d59e54d
fix: Giscus URL 清理 + Fuwari/Mermaid 样式(toolbar 衬条) (#4005)
tangly1024 May 4, 2026
02ddeae
fix(themes): CONTACT_EMAIL helpers and migration docs
tanglyqq May 5, 2026
1c26268
feat(theme-switch): manifest, tier badges, wider panel, docs
tanglyqq May 5, 2026
4e89274
Merge pull request #4013 from tangly1024/fix/contact-email-themes-and…
tanglyqq May 5, 2026
8a60861
fix(deploy): align .nvmrc with EdgeOne Node catalog (20.18.0) (#4017)
tangly1024 May 7, 2026
f5283fe
style(starter): tune content max-width for readability (#4018)
tangly1024 May 7, 2026
b038afe
fix(ui): theme switch floating pill follows dark mode via isDarkMode …
tangly1024 May 7, 2026
18545a8
chore(deps-dev): bump postcss from 8.5.6 to 8.5.10 (#3996)
dependabot[bot] May 8, 2026
72cb017
chore(deps): bump axios from 1.14.0 to 1.15.0 (#3997)
dependabot[bot] May 8, 2026
24da6d9
chore(deps): bump lodash from 4.17.21 to 4.18.1 (#3999)
dependabot[bot] May 8, 2026
e1f0792
chore(deps): bump follow-redirects from 1.15.11 to 1.16.0 (#4000)
dependabot[bot] May 8, 2026
e4aeea7
fix: await async generateRss/checkDataFromAlgolia in getStaticProps (…
xueayi May 8, 2026
fd8ef41
chore(build): 构建前清理 public/rss 陈旧静态文件 (#4021)
tangly1024 May 8, 2026
3df7548
chore(deps): bump axios from 1.15.0 to 1.15.2 (#4020)
dependabot[bot] May 8, 2026
661e66e
Update FUNDING.yml
tangly1024 May 8, 2026
a8943ff
fix(fuwari): 目录 TOC 随阅读位置滚动并同步侧栏/抽屉
May 9, 2026
c5c10fc
chore(deps): bump picomatch from 2.3.1 to 2.3.2 (#4027)
dependabot[bot] May 9, 2026
4f8a7f2
chore(deps): bump flatted from 3.3.2 to 3.4.2 (#4024)
dependabot[bot] May 9, 2026
3b1437a
feat(article-lock): SHA256 密码摘要并兼容旧版 md5(承接 PR #3389) (#4022)
tangly1024 May 9, 2026
8acece2
更新Twikoo前端版本 (#4025)
lyizhuo May 9, 2026
dba70cf
Codex/notion data format compat (#4023)
qianzhu18 May 9, 2026
b04dff9
feat(ui): 文章路由切换时全局骨架占位 (#4030)
tangly1024 May 9, 2026
fdac757
fix: normalize newer notion heading blocks
qianzhu18 May 9, 2026
65f37b8
Merge origin/main into codex/issue-3861-heading-compat
tangly1024 May 10, 2026
f12d9ae
Merge pull request #4031 from qianzhu18/codex/issue-3861-heading-compat
tangly1024 May 10, 2026
4f6e0a4
ci: auto bump package patch version on push to main
tangly1024 May 10, 2026
a1740c4
docs: add community site roadmap (#4036)
qianzhu18 May 13, 2026
1c60cc5
perf(rss): avoid duplicate feed generation across locales (#4034)
qianzhu18 May 13, 2026
9421988
fix(build): share static path work across build workers (#4033)
qianzhu18 May 13, 2026
e4e8666
Merge branch 'main' into update
lifeafter619 May 13, 2026
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
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@
# MAILCHIMP_API_KEY=
# NEXT_PUBLIC_DEBUG=
# ENABLE_CACHE=
# NEXT_PUBLIC_CLAUDE_README_CACHE_ENABLED=
# NEXT_PUBLIC_CLAUDE_CONTRIBUTION_PERSIST_ENABLED=
# NEXT_PUBLIC_CLAUDE_CONTRIBUTION_EVENT_LIMIT=50000
# CLAUDE_CONTRIBUTION_FORCE_REFRESH=false
# CLAUDE_CONTRIBUTION_TRIGGER_TOKEN=
# SUPABASE_URL=
# SUPABASE_SECRET_KEY=
# NEXT_PUBLIC_SUPABASE_URL=
# NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=
# SUPABASE_SERVICE_ROLE_KEY=
# VERCEL_ENV=
# NEXT_PUBLIC_VERSION=
# NEXT_BUILD_STANDALONE=
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# These are supported funding model platforms
ko_fi: tangly1024
buy_me_a_coffee: tangly1024
48 changes: 48 additions & 0 deletions .github/workflows/bump-version-on-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 每次向 main 推送(含合并 PR)后,自动将 package.json 最后一位小版本 +1。
# 自动提交信息含 [skip-version],避免无限循环。发正式版或大版本时请人工改版本号后再合并。

name: Bump package version on main

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write

concurrency:
group: bump-package-version-main
cancel-in-progress: false

jobs:
bump-patch:
runs-on: ubuntu-latest
# 跳过自动发版机器人自己的提交,防止循环触发
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event.head_commit != null &&
!contains(github.event.head_commit.message, '[skip-version]'))

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump package.json patch (last segment)
run: node scripts/bump-package-patch-version.js

- name: Commit and push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if git diff --quiet package.json; then
echo "No version change (unexpected)."
exit 0
fi
NEW_VER=$(node -p "require('./package.json').version")
git add package.json
git commit -m "chore(release): bump package.json to ${NEW_VER} [skip-version]"
git push
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ package-lock.json
# yarn.lock

.notion-api-lock
.tmp/
.perf/
tsconfig.tsbuildinfo
webpack-internal:/

# TypeScript build info
tsconfig.tsbuildinfo
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock=false
engine-strict=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
20.18.0
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enableImmutableInstalls: false
nodeLinker: node-modules
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ To contribute to NotionNext, follow these steps:
5. Commit your modifications and push the branch.
6. [Create a PR][pr] from the branch in your fork to NotionNext' `main` branch.

## Required Workflow Rules

Please follow these rules for every contribution:

1. Create a dedicated branch for each task (do not commit directly to `main`).
2. Keep PRs focused and minimal (avoid mixing unrelated refactors/config edits).
3. Do not commit personal/local files such as `.env.local`.
4. Do not submit personalized config defaults that can affect other contributors.
5. Run lint/tests before opening PR.

For full Chinese workflow guidance, see:

- [Docs Navigation](./docs/README.md)
- [Contribution Workflow](./docs/CONTRIBUTION_WORKFLOW.md)
- [Configuration Rules](./docs/CONFIGURATION.md)

This project is built with [Next.js][next.js] and `yarn` as the package manager.
Here are some commands that you can use:

Expand Down
66 changes: 66 additions & 0 deletions CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 贡献指南(中文)

- [环境准备](#环境准备)
- [新建主题](#新建主题)
- [新增语言](#新增语言)
- [环境变量](#环境变量)

感谢你愿意为 NotionNext 做贡献!

## 环境准备

请按以下流程参与开发:

1. 在 GitHub 上 Fork 仓库。
2. 克隆到本地(或使用 Codespaces)。
3. 为本次任务创建独立分支。
4. 完成功能或修复并本地验证。
5. 提交并推送分支。
6. 发起 PR 到 NotionNext 的 `main` 分支。

常用命令:

- `yarn`:安装依赖
- `yarn dev`:本地开发
- `yarn build`:生产构建
- `yarn start`:生产模式运行

## 必须遵守的协作规则

1. 每个任务使用独立分支,禁止直接提交到 `main`。
2. PR 保持聚焦,避免把无关重构混在一起。
3. 不要提交个人本地文件(如 `.env.local`)。
4. 不要提交会影响他人的个性化默认配置。
5. 提交前至少执行 lint / type-check / 必要测试。

更多文档导航:

- [文档导航入口(中文)](./docs/README.md)
- [Docs Navigation (English)](./docs/README.en.md)
- [主题迁移指南(中文)](./docs/THEME_MIGRATION_GUIDE.zh-CN.md)
- [Theme Migration Guide (English)](./docs/THEME_MIGRATION_GUIDE.md)

## 新建主题

如果要贡献新主题,请以 `themes/example` 为基础复制一个新目录,目录名即主题 key。

## 新增语言

如需新增本地化语言:

1. 复制 `lib/lang/en-US.js` 并按语言代码重命名(如 `zh-CN.js`)。
2. 完成文本翻译。
3. 在 `lib/lang.js` 注册该语言。
4. 提交 PR。

## 环境变量

1. 复制 `.env.example` 为 `.env.local`。
2. 按需填写配置。
3. 不要提交 `.env.local`。

配置优先级:

1. Notion 配置表(最高)
2. 环境变量
3. `blog.config.js`(最低)
77 changes: 53 additions & 24 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ NotionNext 支持多种部署方式,本指南将详细介绍各种部署选项

## 部署前准备

### 0. 本地统一基线(推荐)

为提升跨平台兼容性(Vercel / Cloudflare Pages / Netlify / EdgeOne Pages 等),本项目建议统一使用以下最简流程:

```bash
# Node 20(版本以仓库根目录 `.nvmrc` 为准,便于与各平台预装列表对齐)
nvm use || nvm install

# Yarn
npm i -g yarn

# 安装依赖 / 本地开发 / 构建
yarn
yarn dev
yarn build
```

### 1. 环境变量配置

创建 `.env.local` 文件并配置必要的环境变量:
Expand All @@ -30,16 +47,16 @@ NEXT_PUBLIC_ANALYTICS_GOOGLE_ID=G-XXXXXXXXXX
在部署前确保项目能够正常构建:

```bash
npm run build
npm run start
yarn build
yarn start
```

### 3. 质量检查

运行完整的质量检查:

```bash
npm run quality
yarn quality
```

## Vercel 部署(推荐)
Expand Down Expand Up @@ -84,9 +101,9 @@ vercel --prod
```json
{
"framework": "nextjs",
"buildCommand": "npm run build",
"buildCommand": "yarn build",
"outputDirectory": ".next",
"installCommand": "npm install",
"installCommand": "yarn",
"functions": {
"pages/api/**/*.js": {
"maxDuration": 30
Expand Down Expand Up @@ -126,7 +143,7 @@ vercel --prod
- 连接你的 GitHub 仓库

2. **构建设置**
- Build command: `npm run build`
- Build command: `yarn build`
- Publish directory: `out`
- 环境变量: `EXPORT=true`

Expand All @@ -137,7 +154,7 @@ vercel --prod

```bash
# 构建静态文件
npm run export
yarn export

# 安装 Netlify CLI
npm install -g netlify-cli
Expand All @@ -158,7 +175,7 @@ netlify deploy --prod --dir=out

```toml
[build]
command = "npm run export"
command = "yarn export"
publish = "out"

[build.environment]
Expand All @@ -178,6 +195,18 @@ netlify deploy --prod --dir=out
status = 301
```

## 腾讯云 EdgeOne Pages

EdgeOne 构建阶段会按仓库中的 `.nvmrc` 切换 Node 版本。若控制台报错类似 **Failed to switch to Node.js x.y.z**,通常是因为平台上 **未提供该补丁版本**(例如仅有 `20.18.0`,而旧版本 `.nvmrc` 写了 `20.20.0`)。

处理方式:

1. **保持上游**:拉取最新 NotionNext,确认 `.nvmrc` 已与 EdgeOne「项目设置 → Node.js 版本」下拉列表中可选版本一致(一般为当前文件中的 `20.18.x`)。
2. **自建仓库**:在 EdgeOne 控制台选择与 `.nvmrc` **完全一致**的 Node 版本;仍失败时检查构建日志是否仍在读取旧的 `.nvmrc`(需推送后再构建)。
3. `package.json` 中 `engines.node` 为 `>=20 <25`,在 Node 20 系列内均可构建;关键是 **构建环境实际安装的版本**能解析 `.nvmrc`。

构建命令与静态导出等与其它平台相同,按需配置环境变量(至少 `NOTION_PAGE_ID`)。

## Docker 部署

### Dockerfile
Expand All @@ -201,7 +230,7 @@ COPY . .

ENV NEXT_TELEMETRY_DISABLED 1

RUN npm run build
RUN yarn build

# Production image, copy all the files and run next
FROM base AS runner
Expand Down Expand Up @@ -278,7 +307,7 @@ docker-compose up -d
### 构建静态文件

```bash
npm run export
yarn export
```

### GitHub Pages 部署
Expand Down Expand Up @@ -312,7 +341,7 @@ jobs:
run: npm ci

- name: Build
run: npm run export
run: yarn export
env:
NOTION_PAGE_ID: ${{ secrets.NOTION_PAGE_ID }}

Expand Down Expand Up @@ -387,32 +416,32 @@ NEXT_PUBLIC_ANALYTICS_GOOGLE_ID=G-XXXXXXXXXX
1. **构建失败**
```bash
# 清理缓存
npm run clean
yarn clean
rm -rf node_modules package-lock.json
npm install
npm run build
yarn
yarn build
```

2. **环境变量问题**
```bash
# 检查环境变量
npm run quality
yarn quality
```

3. **内存不足**
```bash
# 增加 Node.js 内存限制
NODE_OPTIONS="--max-old-space-size=4096" npm run build
NODE_OPTIONS="--max-old-space-size=4096" yarn build
```

### 调试模式

```bash
# 启用调试
DEBUG=* npm run build
DEBUG=* yarn build

# Next.js 调试
NEXT_DEBUG=true npm run dev
NEXT_DEBUG=true yarn dev
```

## 安全检查清单
Expand All @@ -430,8 +459,8 @@ NEXT_DEBUG=true npm run dev
### 数据备份

```bash
# 备份 Notion 数据
npm run backup-notion
# 备份数据(按你的脚本体系执行)
# 例如:node scripts/backup-notion.js

# 备份配置文件
tar -czf config-backup.tar.gz .env.local blog.config.js
Expand All @@ -450,16 +479,16 @@ tar -czf config-backup.tar.gz .env.local blog.config.js

```bash
# 检查依赖更新
npm run check-updates
yarn check-updates

# 更新依赖
npm update
yarn upgrade

# 安全审计
npm audit
yarn audit

# 性能分析
npm run analyze
yarn bundle-report
```

### 版本升级
Expand Down
Loading
Loading