中文简介
这是一个开源的个人博客站点,基于 Next.js + MDX + Contentlayer 构建。内容来源于 Notion,通过同步脚本落盘为 MDX,构建时静态生成页面,部署在 Vercel。
线上地址:https://coooder-blog.vercel.app/
English
An open-source personal blog built with Next.js + MDX + Contentlayer. Content is authored in Notion, synced to local MDX files, and statically built for Vercel.
Live site: https://coooder-blog.vercel.app/
- Notion as the content source, synced to local MDX / Notion 作为内容源并同步到 MDX
- Static export (
output: export) for fast, stable deploys / 静态导出部署稳定 - Tags, TOC, bilingual title/summary / 标签、目录、多语言标题与摘要
- Image localization + compression / 图片本地化与压缩
- GitHub Actions scheduled sync + auto-merge PR / 定时同步 + 自动合并 PR
- Next.js 16 + React 19
- Contentlayer2 + MDX
- Tailwind CSS + Pliny
- Notion API
- GitHub Actions + Vercel
Content pipeline / 内容链路
- Write in Notion Database
- Sync script pulls data → converts to MDX → writes to
data/blog/*.mdx - Contentlayer generates typed data
- Next.js builds & exports static site
Notion handles editing experience; the site builds from local MDX for stability and reproducibility.
yarn install
yarn dev推荐 Node.js 20+。
| Field | Type | Description |
|---|---|---|
| Title | Title | Article title / 标题 |
| Slug | Text | URL slug (optional) / URL 片段 |
| Date | Date | Publish date / 发布时间 |
| Tags | Multi-select | Tags / 标签 |
| Summary | Text | Summary / 摘要 |
| Draft | Checkbox | Draft flag / 草稿 |
| TitleEn | Text | English title (optional) |
| SummaryEn | Text | English summary (optional) |
| Layout | Text/Select | Layout (optional) |
| CanonicalUrl | URL/Text | Canonical URL (optional) |
If your fields differ, override with env vars.
NOTION_TOKEN=
NOTION_DATABASE_ID=
NOTION_INCLUDE_DRAFTS=false
NOTION_IMAGE_QUALITY=75
NOTION_IMAGE_FORMAT=webpOptional field mapping:
NOTION_PROP_TITLE=Title
NOTION_PROP_SLUG=Slug
NOTION_PROP_DATE=Date
NOTION_PROP_TAGS=Tags
NOTION_PROP_SUMMARY=Summary
NOTION_PROP_TITLE_EN=TitleEn
NOTION_PROP_SUMMARY_EN=SummaryEn
NOTION_PROP_DRAFT=Draft
NOTION_PROP_LAYOUT=Layout
NOTION_PROP_CANONICAL_URL=CanonicalUrlyarn dev— local dev / 本地开发yarn build— production build / 生产构建yarn lint— lint / 代码检查yarn sync:blog— Notion → MDX sync / 同步
The Notion Sync workflow runs daily (UTC 02:00), pushes changes to notion-sync, opens a PR, and enables auto-merge.
需要在 GitHub Secrets 中配置:
NOTION_TOKENNOTION_DATABASE_ID
Note: scheduled workflows only run on the default branch.
Recommended: Vercel
- Connect repo
- Build:
yarn build - Output:
out
No Notion env vars needed in Vercel (sync happens in GitHub Actions).
Issues and PRs are welcome.
If you plan to change the theme or sync pipeline, please open an Issue first.
No license file yet. Add one if you plan to reuse the codebase (e.g. MIT).