/awesome-nextjs-notion-blog

Deploy your own Notion-powered website in minutes with Next.js and Vercel.

Primary LanguageTypeScriptMIT LicenseMIT

Example article page

Awesome Next.js-Notion Blog

本项目基于 nextjs-notion-starter-kit 项目修改而成。

完整教程见:如何用Notion搭建自己的博客

New Features

  • 目录放置于左边
  • 增加公众号跳转
  • 修复代码展示 BUG
  • 增加图片放大功能
  • 增加 Google Analytics 分析功能
  • 补全中文教程
  • 支持简单表格
  • 支持文章级别的效果反馈

Setup

All config is defined in site.config.js.

  1. Fork / clone this repo
  2. Change a few values in site.config.js
  3. yarn
  4. yarn dev to test locally
  5. npm run deploy to deploy to vercel 💪

URL Paths

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.

Notes

  • 修改node_modules/进行patch后,vercel需要重新deploy一下,否则会使用默认的依赖包,导致patch失败。

License

MIT ©

This project based on transitivebullsh.it.

Feedback 部分使用的表情包版权来源于 ISUX