本项目基于 nextjs-notion-starter-kit 项目修改而成。
完整教程见:如何用Notion搭建自己的博客
- 目录放置于左边
- 增加公众号跳转
- 修复代码展示 BUG
- 增加图片放大功能
- 增加 Google Analytics 分析功能
- 补全中文教程
- 支持简单表格
- 支持文章级别的效果反馈
All config is defined in site.config.js.
- Fork / clone this repo
- Change a few values in site.config.js
yarn
yarn dev
to test locallynpm run deploy
to deploy to vercel 💪
The app defaults to slightly different pathnames in dev and prod (though pasting any dev pathname into prod will work and vice-versa).
In development, it will use /nextjs-notion-blog-d1b5dcf8b9ff425b8aef5ce6f0730202
which is a slugified version of the page's title suffixed with its Notion ID. I've found that it's really useful to always have the Notion Page ID front and center during local development.
In production, it will use /nextjs-notion-blog
which is a bit nicer as it gets rid of the extra ID clutter.
The mapping of Notion ID to slugified page titles is done automatically for you as part of the build process. Just keep in mind that if you plan on changing page titles over time, you probably want to make sure old links will still work, and we don't currently provide a solution for detecting old links aside from Next.js built-in support for redirects.
See mapPageUrl and getCanonicalPageId from for more details.
NOTE: if you have multiple pages in your workspace with the same slugified name, the app will throw an error letting you know that there are duplicate URL pathnames.
- 修改
node_modules/
进行patch
后,vercel
需要重新deploy
一下,否则会使用默认的依赖包,导致patch
失败。
MIT ©
This project based on transitivebullsh.it.
Feedback 部分使用的表情包版权来源于 ISUX