Skip to content
Merged

fff #13

Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 22 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
# Contributing

- [Repository and organization](#repository-and-organization)
- [Setup](#setup)
- [Creating new themes](#creating-new-themes)
- [Adding localizations](#adding-localizations)
- [Environment Variables](#environment-variables)

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:
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
# 贡献指南(中文)

- [仓库与组织](#仓库与组织)
- [环境准备](#环境准备)
- [新建主题](#新建主题)
- [新增语言](#新增语言)
- [环境变量](#环境变量)

感谢你愿意为 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**。

## 环境准备

请按以下流程参与开发:
Expand All @@ -33,6 +51,8 @@
4. 不要提交会影响他人的个性化默认配置。
5. 提交前至少执行 lint / type-check / 必要测试。

维护者与高频贡献者请阅读 [维护与变更尺度(共识)](./docs/MAINTENANCE_PHILOSOPHY.zh-CN.md),避免大范围、难回滚的改动影响主线稳定。

更多文档导航:

- [文档导航入口(中文)](./docs/README.md)
Expand Down
52 changes: 38 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
# 帮助教程
<div align="center">

访问帮助:[NotionNext帮助手册](https://docs.tangly1024.com/)
<img src="https://github.com/user-attachments/assets/c111204d-2016-4343-92e4-83357cac4b19" width="96" height="96" alt="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,仅作友情推广
<p>
<a href="https://preview.tangly1024.com/">
在线预览
</a>
·
<a href="https://docs.tangly1024.com/">
文档
</a>
·
<a href="./CONTRIBUTING.md">
参与贡献
</a>
</p>

</div>

---
# 帮助教程

> 本项目为免费、公开资源,仅限个人学习使用,禁止利用本教程建立的博客发布非法内容、进行违法犯罪活动。

Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档、管理笔记,搭建知识库,甚至可以为你规划项目、时间管理、组织团队、提高生产力、还有当前最强大的AI技术加持。

# NotionNext

<p>
<a aria-label="GitHub commit activity" href="https://github.com/tangly1024/NotionNext/commits/main" title="GitHub commit activity">
<img src="https://img.shields.io/github/commit-activity/m/tangly1024/NotionNext?style=for-the-badge"/>
<a aria-label="GitHub commit activity" href="https://github.com/notionnext-org/NotionNext/commits/main" title="GitHub commit activity">
<img src="https://img.shields.io/github/commit-activity/m/notionnext-org/NotionNext?style=for-the-badge"/>
</a>
<a aria-label="GitHub contributors" href="https://github.com/tangly1024/NotionNext/graphs/contributors" title="GitHub contributors">
<img src="https://img.shields.io/github/contributors/tangly1024/NotionNext?color=orange&style=for-the-badge"/>
<a aria-label="GitHub contributors" href="https://github.com/notionnext-org/NotionNext/graphs/contributors" title="GitHub contributors">
<img src="https://img.shields.io/github/contributors/notionnext-org/NotionNext?color=orange&style=for-the-badge"/>
</a>
<a aria-label="Build status" href="#" title="Build status">
<img src="https://img.shields.io/github/deployments/tangly1024/NotionNext/Production?logo=Vercel&style=for-the-badge"/>
<img src="https://img.shields.io/github/deployments/notionnext-org/NotionNext/Production?logo=Vercel&style=for-the-badge"/>
</a>
<a aria-label="Powered by Vercel" href="https://vercel.com?utm_source=Craigary&utm_campaign=oss" title="Powered by Vercel">
<img src="https://www.datocms-assets.com/31049/1618983297-powered-by-vercel.svg" height="28"/>
Expand All @@ -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 分钟上手
Expand Down Expand Up @@ -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)

## 预览效果

Expand All @@ -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)

## 引用技术

Expand All @@ -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)
16 changes: 10 additions & 6 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ You can set up your personal website in just a few minutes. Here is the link to
# NotionNext

<p>
<a aria-label="GitHub commit activity" href="https://github.com/tangly1024/NotionNext/commits/main" title="GitHub commit activity">
<img src="https://img.shields.io/github/commit-activity/m/tangly1024/NotionNext?style=for-the-badge"/>
<a aria-label="GitHub commit activity" href="https://github.com/notionnext-org/NotionNext/commits/main" title="GitHub commit activity">
<img src="https://img.shields.io/github/commit-activity/m/notionnext-org/NotionNext?style=for-the-badge"/>
</a>
<a aria-label="GitHub contributors" href="https://github.com/tangly1024/NotionNext/graphs/contributors" title="GitHub contributors">
<img src="https://img.shields.io/github/contributors/tangly1024/NotionNext?color=orange&style=for-the-badge"/>
<a aria-label="GitHub contributors" href="https://github.com/notionnext-org/NotionNext/graphs/contributors" title="GitHub contributors">
<img src="https://img.shields.io/github/contributors/notionnext-org/NotionNext?color=orange&style=for-the-badge"/>
</a>
<a aria-label="Build status" href="#" title="Build status">
<img src="https://img.shields.io/github/deployments/tangly1024/NotionNext/Production?logo=Vercel&style=for-the-badge"/>
<img src="https://img.shields.io/github/deployments/notionnext-org/NotionNext/Production?logo=Vercel&style=for-the-badge"/>
</a>
<a aria-label="Powered by Vercel" href="https://vercel.com?utm_source=Craigary&utm_campaign=oss" title="Powered by Vercel">
<img src="https://www.datocms-assets.com/31049/1618983297-powered-by-vercel.svg" height="28"/>
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
26 changes: 26 additions & 0 deletions __tests__/lib/staticPaths.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
51 changes: 51 additions & 0 deletions docs/MAINTENANCE_PHILOSOPHY.en.md
Original file line number Diff line number Diff line change
@@ -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/<name>/`; 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.
Loading
Loading