diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f98407d6c2a..85771d6fa27 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,6 @@ # Contributing +- [Repository and organization](#repository-and-organization) - [Setup](#setup) - [Creating new themes](#creating-new-themes) - [Adding localizations](#adding-localizations) @@ -7,6 +8,23 @@ Thanks for considering to contribute! +## Repository and organization + +The canonical repository is now under the **[notionnext-org](https://github.com/notionnext-org)** GitHub organization (moved from personal ownership for clearer governance): + +**https://github.com/notionnext-org/NotionNext** + +If you contribute long-term or help with org-wide automation, check the organization page for how to join. **You are welcome to request membership** when that fits your role. + +If you cloned the repo before the transfer, update your default remote so you do not rely on redirects forever: + +```bash +git remote set-url origin https://github.com/notionnext-org/NotionNext.git +git remote -v +``` + +The fork-and-PR workflow is unchanged; open pull requests against **notionnext-org/NotionNext**. + ## Setup To contribute to NotionNext, follow these steps: @@ -28,6 +46,8 @@ Please follow these rules for every contribution: 4. Do not submit personalized config defaults that can affect other contributors. 5. Run lint/tests before opening PR. +Core maintainers should also read [Maintenance and change-control philosophy](./docs/MAINTENANCE_PHILOSOPHY.en.md) to keep `main` stable and reviewable. + For full Chinese workflow guidance, see: - [Docs Navigation](./docs/README.md) @@ -72,8 +92,8 @@ The configuration priority is: 2. Environment Variables 3. blog.config.js (lowest) -[fork]: https://github.com/tangly1024/NotionNext/fork -[pr]: https://github.com/tangly1024/NotionNext/compare +[fork]: https://github.com/notionnext-org/NotionNext/fork +[pr]: https://github.com/notionnext-org/NotionNext/compare [next.js]: https://github.com/vercel/next.js [themes-dir]: themes [example]: themes/example diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.md index 28952f5dc62..1b95e41b692 100644 --- a/CONTRIBUTING.zh-CN.md +++ b/CONTRIBUTING.zh-CN.md @@ -1,5 +1,6 @@ # 贡献指南(中文) +- [仓库与组织](#仓库与组织) - [环境准备](#环境准备) - [新建主题](#新建主题) - [新增语言](#新增语言) @@ -7,6 +8,23 @@ 感谢你愿意为 NotionNext 做贡献! +## 仓库与组织 + +本仓库已由**个人账号**托管转为 **[GitHub 组织 notionnext-org](https://github.com/notionnext-org)** 管理,canonical 地址为: + +**https://github.com/notionnext-org/NotionNext** + +若你希望参与长期维护、CI 或组织内协作,可关注组织主页说明并申请加入(具体以组织公告为准)。**欢迎加入组织**,与维护者一起推进项目。 + +若你仍在使用转让前克隆的本地仓库,建议将默认远端改为组织地址,避免长期依赖旧 URL 重定向: + +```bash +git remote set-url origin https://github.com/notionnext-org/NotionNext.git +git remote -v +``` + +Fork 开发与向 `main` 提 PR 的流程不变;PR 的目标仓库请选择 **notionnext-org/NotionNext**。 + ## 环境准备 请按以下流程参与开发: @@ -33,6 +51,8 @@ 4. 不要提交会影响他人的个性化默认配置。 5. 提交前至少执行 lint / type-check / 必要测试。 +维护者与高频贡献者请阅读 [维护与变更尺度(共识)](./docs/MAINTENANCE_PHILOSOPHY.zh-CN.md),避免大范围、难回滚的改动影响主线稳定。 + 更多文档导航: - [文档导航入口(中文)](./docs/README.md) diff --git a/README.md b/README.md index c3e6f78ded5..46062a99a16 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,47 @@ -# 帮助教程 +
-访问帮助:[NotionNext帮助手册](https://docs.tangly1024.com/) +NotionNext Logo -> 本项目教程为免费、公开资源,仅限个人学习使用,禁止利用本教程建立的博客发布非法内容、进行违法犯罪活动。严禁任何个人或组织将本教程用于商业用途,包括但不限于直接售卖、间接收费、或其他变相盈利行为。转载、复制或介绍本教程内容时,须保留作者信息并明确注明来源。 -> 本项目仅提供由作者团队授权的付费咨询服务,请注意辨别,谨防诈骗行为。任何未经授权的收费服务均可能存在法律风险。 +# NotionNext -Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档、管理笔记,搭建知识库,甚至可以为你规划项目、时间管理、组织团队、提高生产力、还有当前最强大的AI技术加持。 +一个使用 Next.js + Notion API 构建的高颜值静态博客系统 -> 若希望进一步探索Notion的功能,欢迎购买《[Notion笔记从入门到精通进阶课程](https://docs.tangly1024.com/article/notion-tutorial)》 +为 Notion 与所有创作者设计 ✨ -> 若希望获得稳定、高速、不限设备数量的VPN科学上网服务,欢迎使用[飞鸟VPN](https://fbinv02.fbaff.cc/auth/register?code=kaA7t4kh),这是我目前在用的VPN,仅作友情推广 +

+ + 在线预览 + + · + + 文档 + + · + + 参与贡献 + +

+ +
+ +--- +# 帮助教程 + +> 本项目为免费、公开资源,仅限个人学习使用,禁止利用本教程建立的博客发布非法内容、进行违法犯罪活动。 + +Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档、管理笔记,搭建知识库,甚至可以为你规划项目、时间管理、组织团队、提高生产力、还有当前最强大的AI技术加持。 # NotionNext

- - + + - - + + - + @@ -34,6 +54,8 @@ Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档 一个使用 NextJS + Notion API 实现的,部署在 Vercel 上的静态博客系统。为Notion和所有创作者设计。 +**仓库托管:** 主仓库现由 GitHub 组织 **[notionnext-org](https://github.com/notionnext-org)** 维护(canonical:`https://github.com/notionnext-org/NotionNext`)。欢迎参与贡献并关注组织内协作说明;若在转让前已克隆本地仓库,建议执行 `git remote set-url origin https://github.com/notionnext-org/NotionNext.git` 后使用 `git remote -v` 确认。 + 支持多种部署方案 ## 新开发者 3 分钟上手 @@ -69,6 +91,8 @@ yarn dev - [Theme Migration Guide (English)](./docs/THEME_MIGRATION_GUIDE.md) - [贡献入口(中文)](./CONTRIBUTING.zh-CN.md) - [贡献入口(英文)](./CONTRIBUTING.md) +- [维护与变更尺度(中文)](./docs/MAINTENANCE_PHILOSOPHY.zh-CN.md) +- [Maintenance & change control (English)](./docs/MAINTENANCE_PHILOSOPHY.en.md) ## 预览效果 @@ -90,7 +114,7 @@ yarn dev 致敬每一位开发者! -[![Contributors](https://contrib.rocks/image?repo=tangly1024/NotionNext)](https://github.com/tangly1024/NotionNext/graphs/contributors) +[![Contributors](https://contrib.rocks/image?repo=notionnext-org/NotionNext)](https://github.com/notionnext-org/NotionNext/graphs/contributors) ## 引用技术 @@ -110,4 +134,4 @@ The MIT License. ## Star History -[![Star History Chart](https://api.star-history.com/svg?repos=tangly1024/NotionNext&type=Date)](https://star-history.com/#tangly1024/NotionNext&Date) +[![Star History Chart](https://api.star-history.com/svg?repos=notionnext-org/NotionNext&type=Date)](https://star-history.com/#notionnext-org/NotionNext&Date) diff --git a/README_EN.md b/README_EN.md index d4b84d98059..88c51f57e20 100644 --- a/README_EN.md +++ b/README_EN.md @@ -13,14 +13,14 @@ You can set up your personal website in just a few minutes. Here is the link to # NotionNext

- - + + - - + + - + @@ -34,6 +34,8 @@ You can set up your personal website in just a few minutes. Here is the link to A static blog system built with NextJS and Notion API, deployed on Vercel. Designed for Notion and all creators. +**Repository hosting:** The main repository is maintained by the GitHub organization **[notionnext-org](https://github.com/notionnext-org)** (canonical: `https://github.com/notionnext-org/NotionNext`). Contributions are welcome; see the org page for collaboration. If you cloned before the transfer, run `git remote set-url origin https://github.com/notionnext-org/NotionNext.git` and verify with `git remote -v`. + ## 3-Minute Quick Start @@ -67,6 +69,8 @@ To help new contributors get started quickly, the project keeps docs bilingual w - [Theme Migration Guide (English)](./docs/THEME_MIGRATION_GUIDE.md) - [贡献入口(中文)](./CONTRIBUTING.zh-CN.md) - [Contribution Guide (English)](./CONTRIBUTING.md) +- [维护与变更尺度(中文)](./docs/MAINTENANCE_PHILOSOPHY.zh-CN.md) +- [Maintenance & change control (English)](./docs/MAINTENANCE_PHILOSOPHY.en.md) ## Preview @@ -88,7 +92,7 @@ Special thanks to Craig Hart for initiating the Nobelium project. This project exists thanks to all the people who contribute. -[![Contributors](https://contrib.rocks/image?repo=tangly1024/NotionNext)](https://github.com/tangly1024/NotionNext/graphs/contributors) +[![Contributors](https://contrib.rocks/image?repo=notionnext-org/NotionNext)](https://github.com/notionnext-org/NotionNext/graphs/contributors) ## Technologies Used diff --git a/__tests__/lib/staticPaths.test.js b/__tests__/lib/staticPaths.test.js index d891b44d7d8..d08dd1d3cc1 100644 --- a/__tests__/lib/staticPaths.test.js +++ b/__tests__/lib/staticPaths.test.js @@ -46,6 +46,32 @@ describe('staticPaths build helpers', () => { }) }) + it('does not keep a rejected allPages lookup pinned in process memory', async () => { + isExport.mockReturnValue(false) + fetchGlobalAllData + .mockRejectedValueOnce(new Error('notion unavailable')) + .mockResolvedValueOnce({ + allPages: [ + { id: '1', slug: 'hello', type: 'Post', status: 'Published' } + ] + }) + getPriorityPages.mockReturnValue([]) + + await jest.isolateModulesAsync(async () => { + const { getSharedAllPages } = require('@/lib/build/staticPaths') + + await expect(getSharedAllPages({ from: 'slug-paths' })).rejects.toThrow( + 'notion unavailable' + ) + await expect(getSharedAllPages({ from: 'slug-paths' })).resolves.toEqual([ + { id: '1', slug: 'hello', type: 'Post', status: 'Published' } + ]) + + expect(fetchGlobalAllData).toHaveBeenCalledTimes(2) + expect(getOrSetDataWithCache).toHaveBeenCalledTimes(2) + }) + }) + it('prefetches once per route call in export mode and returns all matching paths', async () => { isExport.mockReturnValue(true) fetchGlobalAllData.mockResolvedValue({ diff --git a/docs/MAINTENANCE_PHILOSOPHY.en.md b/docs/MAINTENANCE_PHILOSOPHY.en.md new file mode 100644 index 00000000000..277c47d5e48 --- /dev/null +++ b/docs/MAINTENANCE_PHILOSOPHY.en.md @@ -0,0 +1,51 @@ +# Maintenance and change-control philosophy + +This document is for **core maintainers and frequent contributors**. Read it together with [Contributing](../CONTRIBUTING.md) and [Contribution workflow](./CONTRIBUTION_WORKFLOW.en.md). The goal is to welcome contributions while **reducing large, hard-to-control changes** that destabilize `main` and fork ecosystems. + +## Principles + +1. **Small, reviewable, revertible steps**: Prefer several focused PRs over one huge, hard-to-review batch. +2. **Intent before code**: For behavior or data-contract changes, align scope in an Issue or Discussion before opening the PR. +3. **Protect core paths**: Data layer, routing, global config, and build/export pipelines affect the whole project—PRs should explain motivation, risk, and how they were verified. +4. **No unrelated refactors mixed in**: Do not bundle wide renames, mass formatting, or major dependency bumps with unrelated fixes or features; split PRs when needed. +5. **Dependencies and toolchain**: Major framework or lockfile-policy upgrades need rationale, breaking-change notes, and regression checks (build, critical-path tests). + +## Suggested PR sizing + +| Kind | Suggested approach | +| --- | --- | +| Bugfix | Minimal fix + tests or clear repro notes | +| Small feature / theme-local | Keep within theme or a single module boundary; avoid drive-by shared-layer edits | +| Cross-theme / shared API | Agree API and defaults in an Issue first; keep migrations documented | +| Breaking changes | Document version/config migration; split into phases if it helps reviewers | + +## High-impact areas (extra clarity expected) + +Changes here tend to affect all sites or many themes—**PR descriptions and verification notes should be stronger** (whether two-person review is required is up to owners and maintainers): + +- `lib/db/` (including `SiteDataApi`, Notion fetch and caching) +- `pages/` SSG/ISR, i18n, and build-lifecycle logic +- `next.config.js` and export/build scripts +- Global config (`blog.config.js`, `lib/config.js`, and similar defaults) +- Security-sensitive areas: auth, secrets, third-party callbacks, CSP, etc. + +## Keeping the project from drifting + +- **Prefer opt-in or configurable behavior** for niche site assumptions; avoid baking them into global defaults. +- **Theme isolation**: Keep theme-specific logic under `themes//`; avoid encoding one theme’s UI or routing in shared layers. +- **Docs in lockstep**: When user-visible behavior or config keys change, update docs (EN/ZH as applicable) in the same or a follow-up PR. + +## GitHub roles (for owners) + +Repository **owners** (personal repo owner, or org owners) can invite trusted maintainers (for example [@qianzhu18](https://github.com/qianzhu18)) as collaborators with **Write**, **Maintain**, or **Admin**, depending on how much repo administration you want to delegate. + +If **branch protection** or **third-party checks** (e.g. deploy authorization) often block merges, either add trusted actors under **bypass** in **Settings → Branches**, or agree explicitly when owners merge on behalf of maintainers. + +Exact GitHub UI labels change over time; governance (who may merge, when bypass is acceptable) should be agreed in writing among maintainers, not only implied by defaults. + +## Related docs + +- [Contribution workflow](./CONTRIBUTION_WORKFLOW.en.md) +- [Architecture](./ARCHITECTURE.en.md), [Project structure](./PROJECT_STRUCTURE.en.md) + +Revise this document as the project evolves; for major edits, leave a short note in an Issue or Discussion so future readers understand the rationale. diff --git a/docs/MAINTENANCE_PHILOSOPHY.zh-CN.md b/docs/MAINTENANCE_PHILOSOPHY.zh-CN.md new file mode 100644 index 00000000000..a39d748d8f6 --- /dev/null +++ b/docs/MAINTENANCE_PHILOSOPHY.zh-CN.md @@ -0,0 +1,51 @@ +# 维护与变更尺度(共识) + +本文面向**核心维护者与高频贡献者**,与 [贡献指南](../CONTRIBUTING.zh-CN.md)、[提交与 PR 规范](./CONTRIBUTION_WORKFLOW.md)一起阅读。目标是在欢迎贡献的同时,**尽量避免大量不可控、难回滚的改动**,降低 `main` 与下游 fork 被拖离稳定形态的风险。 + +## 原则 + +1. **小步、可审、可回滚**:宁可多几个聚焦的 PR,也不要一个巨型「一锅端」难以评审的变更。 +2. **先对齐意图再写代码**:涉及行为或数据契约的改动,尽量先在 Issue / Discussion 里对齐范围,再开 PR。 +3. **守住核心路径**:数据层、路由、全局配置、构建与导出链路影响全站——PR 中应写清动机、风险与验证方式。 +4. **禁止夹带无关重构**:不要把大范围重命名、整仓格式化、大版本依赖升级与无关 bugfix/功能混在同一 PR;必要时拆分。 +5. **依赖与工具链**:框架大版本、锁文件策略类变更需说明理由、破坏性变更与回归验证(构建、关键路径测试等)。 + +## 建议的 PR 粒度 + +| 类型 | 建议 | +| --- | --- | +| Bug 修复 | 最小改动 + 测试或可复现说明 | +| 小功能 / 单主题 | 尽量限制在主题目录或单一模块边界,避免顺手改共享层 | +| 跨主题 / 公共 API | 先在 Issue 对齐接口与默认值,迁移路径写进文档 | +| 破坏性变更 | 写清版本与配置迁移;必要时拆阶段便于评审 | + +## 高影响区域(期望说明更充分) + +以下改动往往影响全站或多主题——**PR 描述与验证说明应更完整**(是否必须双人评审由仓库所有者与维护者共同约定): + +- `lib/db/`(含 `SiteDataApi`、Notion 拉取与缓存) +- `pages/` 下的 SSG/ISR、i18n、构建生命周期相关逻辑 +- `next.config.js` 与导出/构建脚本 +- 全局配置(`blog.config.js`、`lib/config.js` 及同类默认行为) +- 安全相关:鉴权、密钥、第三方回调、CSP 等 + +## 避免项目「漂太远」 + +- **小众站点假设尽量做成可选项或配置项**,避免写进影响所有人的全局默认。 +- **主题隔离**:主题专属逻辑放在 `themes//`,避免把某一主题的 UI 或路由假设写进共享层。 +- **文档同步**:用户可见行为或配置项变更时,在同一 PR 或紧随其后的 PR 中更新文档(中英视情况)。 + +## GitHub 权限(供仓库所有者操作) + +仓库**所有者**(个人仓库的拥有者,或组织的 Owner)可在 **Settings → Collaborators**(或组织下的 **Teams / Repository access**)邀请信任的维护者(例如 [@qianzhu18](https://github.com/qianzhu18)),并按信任程度授予 **Write / Maintain / Admin** 等角色;是否需要能改分支保护、管理部分仓库设置,决定选 **Maintain** 还是 **Admin**。 + +若 **分支保护** 或 **第三方检查**(如部署需授权)经常导致无法合并,可在 **Settings → Branches** 中为受信维护者配置 **bypass**,或由所有者与维护者书面约定在何种情况下由谁代为合并。 + +GitHub 界面文案会随产品迭代变化;**谁可以合并、何时允许绕过检查**等治理规则,建议在维护者之间留下文字共识(Issue、Discussion 或本仓库文档的修订说明),而不要仅依赖默认设置。 + +## 相关文档 + +- [提交与 PR 规范](./CONTRIBUTION_WORKFLOW.md) +- [架构总览](./ARCHITECTURE.md)、[目录与模块说明](./PROJECT_STRUCTURE.md) + +本文档随项目演进可修订;重大修订建议在 Issue 或 Discussion 中留一句背景,便于后来者理解。 diff --git a/docs/README.en.md b/docs/README.en.md index 9c22198ac91..79c59d9a297 100644 --- a/docs/README.en.md +++ b/docs/README.en.md @@ -4,6 +4,16 @@ This docs directory helps contributors and new developers understand the project quickly and collaborate safely. +## Repository and organization + +The main repository is maintained by the GitHub organization **[notionnext-org](https://github.com/notionnext-org)** (canonical: `https://github.com/notionnext-org/NotionNext`). **You are welcome to request org membership** when that fits your role. If you cloned before the transfer, run: + +```bash +git remote set-url origin https://github.com/notionnext-org/NotionNext.git +``` + +See [Contributing](../CONTRIBUTING.md#repository-and-organization) (and the Chinese contributing guide) for details. + ## Start Here (5 minutes) | Topic | English | 中文 | @@ -13,6 +23,7 @@ This docs directory helps contributors and new developers understand the project | Project Structure | [PROJECT_STRUCTURE.en.md](./PROJECT_STRUCTURE.en.md) | [PROJECT_STRUCTURE.md](./PROJECT_STRUCTURE.md) | | Configuration | [CONFIGURATION.en.md](./CONFIGURATION.en.md) | [CONFIGURATION.md](./CONFIGURATION.md) | | Contribution Workflow | [CONTRIBUTION_WORKFLOW.en.md](./CONTRIBUTION_WORKFLOW.en.md) | [CONTRIBUTION_WORKFLOW.md](./CONTRIBUTION_WORKFLOW.md) | +| Maintenance & change control | [MAINTENANCE_PHILOSOPHY.en.md](./MAINTENANCE_PHILOSOPHY.en.md) | [MAINTENANCE_PHILOSOPHY.zh-CN.md](./MAINTENANCE_PHILOSOPHY.zh-CN.md) | | Theme Migration Guide | [THEME_MIGRATION_GUIDE.md](./THEME_MIGRATION_GUIDE.md) | [THEME_MIGRATION_GUIDE.zh-CN.md](./THEME_MIGRATION_GUIDE.zh-CN.md) | ## Purpose diff --git a/docs/README.md b/docs/README.md index b2d385e89f6..1d168e2332c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,6 +4,16 @@ 本目录用于帮助开源贡献者和新开发者快速理解项目并安全协作。 +## 仓库与组织 + +主仓库现由 GitHub 组织 **[notionnext-org](https://github.com/notionnext-org)** 管理(canonical:`https://github.com/notionnext-org/NotionNext`),已从个人账号迁移以便长期治理。**欢迎加入组织**参与协作(以组织内说明为准)。若在迁移前已克隆本地仓库,建议执行: + +```bash +git remote set-url origin https://github.com/notionnext-org/NotionNext.git +``` + +详见 [贡献指南(中文)](../CONTRIBUTING.zh-CN.md#仓库与组织) / [Contributing (English)](../CONTRIBUTING.md#repository-and-organization)。 + ## 文档入口(中英双语) | 主题 | 中文 | English | @@ -13,6 +23,7 @@ | 目录与模块说明 | [PROJECT_STRUCTURE.md](./PROJECT_STRUCTURE.md) | [PROJECT_STRUCTURE.en.md](./PROJECT_STRUCTURE.en.md) | | 配置体系说明 | [CONFIGURATION.md](./CONFIGURATION.md) | [CONFIGURATION.en.md](./CONFIGURATION.en.md) | | 提交与 PR 规范 | [CONTRIBUTION_WORKFLOW.md](./CONTRIBUTION_WORKFLOW.md) | [CONTRIBUTION_WORKFLOW.en.md](./CONTRIBUTION_WORKFLOW.en.md) | +| 维护与变更尺度 | [MAINTENANCE_PHILOSOPHY.zh-CN.md](./MAINTENANCE_PHILOSOPHY.zh-CN.md) | [MAINTENANCE_PHILOSOPHY.en.md](./MAINTENANCE_PHILOSOPHY.en.md) | | 主题迁移指南 | [THEME_MIGRATION_GUIDE.zh-CN.md](./THEME_MIGRATION_GUIDE.zh-CN.md) | [THEME_MIGRATION_GUIDE.md](./THEME_MIGRATION_GUIDE.md) | | 社区官网能力扩展路线 | [COMMUNITY_SITE_ROADMAP.md](./COMMUNITY_SITE_ROADMAP.md) | — | diff --git a/lib/build/staticPaths.js b/lib/build/staticPaths.js index 85af6ac3386..896615620d3 100644 --- a/lib/build/staticPaths.js +++ b/lib/build/staticPaths.js @@ -7,7 +7,10 @@ import { isExport } from '@/lib/utils/buildMode' const inProcessAllPagesPromises = new Map() function getStaticPathsCacheKey({ pageId = BLOG.NOTION_PAGE_ID, locale }) { - const safePageId = String(pageId || 'default').replace(/[^a-z0-9,_:-]/gi, '_') + const safePageId = String(pageId || BLOG.NOTION_PAGE_ID).replace( + /[^a-z0-9,_:-]/gi, + '_' + ) const safeLocale = String(locale || 'default').replace(/[^a-z0-9_-]/gi, '_') return `build_static_paths_all_pages_${safeLocale}_${safePageId}` } @@ -28,6 +31,9 @@ export function getSharedAllPages({ }) return Array.isArray(allPages) ? allPages : [] }) + promise.catch(() => { + inProcessAllPagesPromises.delete(cacheKey) + }) inProcessAllPagesPromises.set(cacheKey, promise) } diff --git a/lib/config.js b/lib/config.js index cecd5a27004..98ca408dde3 100644 --- a/lib/config.js +++ b/lib/config.js @@ -82,6 +82,17 @@ export const siteConfig = (key, defaultVal = null, extendConfig = {}) => { case 'DESCRIPTION': val = siteInfo?.description // 标题取Notion中的标题 break + // Notion 配置表里常见误用 env 风格键名;与 conf/comment.config.js 中 COMMENT_* 对齐 + case 'COMMENT_WALINE_SERVER_URL': + val = + global.NOTION_CONFIG?.WALINE_SERVER_URL || + global.NOTION_CONFIG?.NEXT_PUBLIC_WALINE_SERVER_URL + break + case 'COMMENT_WALINE_RECENT': + val = + global.NOTION_CONFIG?.WALINE_RECENT || + global.NOTION_CONFIG?.NEXT_PUBLIC_WALINE_RECENT + break } } diff --git a/lib/db/SiteDataApi.js b/lib/db/SiteDataApi.js index 60c81e2e536..0d1bd2c816d 100644 --- a/lib/db/SiteDataApi.js +++ b/lib/db/SiteDataApi.js @@ -485,10 +485,12 @@ function handleDataBeforeReturn(db) { db.customMenu = cleanIds(db?.customMenu) db.allNavPages = shortenIds(db?.allNavPages) + // 先清理 tagOptions,再用清理后的标签集合过滤页面的 tagItems, + // 避免页面保留对「已被 cleanTagOptions 删除的标签」的引用,导致点击 404 + db.tagOptions = cleanTagOptions(db?.tagOptions) db.allNavPages = cleanPages(db?.allNavPages, db.tagOptions) db.allPages = cleanPages(db.allPages, db.tagOptions) db.latestPosts = cleanPages(db.latestPosts, db.tagOptions) - db.tagOptions = cleanTagOptions(db?.tagOptions) // 定时发布:检查发布时间窗口,超出范围的隐藏 const POST_SCHEDULE_PUBLISH = siteConfig( diff --git a/pages/[prefix]/[slug]/[...suffix].js b/pages/[prefix]/[slug]/[...suffix].js index 59ab3d7c13b..dda24a415e4 100644 --- a/pages/[prefix]/[slug]/[...suffix].js +++ b/pages/[prefix]/[slug]/[...suffix].js @@ -1,9 +1,10 @@ import BLOG from '@/blog.config' import { siteConfig } from '@/lib/config' import { resolvePostProps } from '@/lib/db/SiteDataApi' +import { getStaticPathsBase } from '@/lib/build/staticPaths' +import { isExport } from '@/lib/utils/buildMode' import { checkSlugHasMorThanTwoSlash } from '@/lib/utils/post' import Slug from '..' -import { getStaticPathsBase } from '@/lib/build/staticPaths' /** * 根据notion的slug访问页面 diff --git a/pages/[prefix]/[slug]/index.js b/pages/[prefix]/[slug]/index.js index 6dac4503a53..1ea684e2fe3 100644 --- a/pages/[prefix]/[slug]/index.js +++ b/pages/[prefix]/[slug]/index.js @@ -2,8 +2,9 @@ import BLOG from '@/blog.config' import { siteConfig } from '@/lib/config' import { resolvePostProps } from '@/lib/db/SiteDataApi' import Slug from '..' -import { checkSlugHasOneSlash } from '@/lib/utils/post' import { getStaticPathsBase } from '@/lib/build/staticPaths' +import { isExport } from '@/lib/utils/buildMode' +import { checkSlugHasOneSlash } from '@/lib/utils/post' /** * 根据notion的slug访问页面 diff --git a/pages/[prefix]/index.js b/pages/[prefix]/index.js index 612d5eaef8f..66092c07e80 100644 --- a/pages/[prefix]/index.js +++ b/pages/[prefix]/index.js @@ -17,6 +17,7 @@ import { useRouter } from 'next/router' import PropTypes from 'prop-types' import { useEffect, useState } from 'react' import { getStaticPathsBase } from '@/lib/build/staticPaths' +import { isExport } from '@/lib/utils/buildMode' /** * 根据notion的slug访问页面 diff --git a/themes/hexo/components/ArticleRecommend.js b/themes/hexo/components/ArticleRecommend.js index 30c9d56c2af..8c38d0cc1a3 100644 --- a/themes/hexo/components/ArticleRecommend.js +++ b/themes/hexo/components/ArticleRecommend.js @@ -40,21 +40,26 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) { title={post.title} href={post?.href} passHref - className='flex h-40 cursor-pointer overflow-hidden'> -

-
-
- {post.title} -
+ className='flex h-40 cursor-pointer overflow-hidden rounded-lg'> +
+ {/* 背景图:略放大 + 轻模糊,弱化细节 */} +
+
- - - {/* 卡片的阴影遮罩,为了凸显图片上的文字 */} -
-
+
+ + {post.title} +