frankcbliu / awesome-nextjs-notion-blog

Deploy your own Notion-powered website in minutes with Next.js and Vercel.
https://szufrank.top/
MIT License
116 stars 104 forks source link
notion notion-blog

Example article page

Awesome Next.js-Notion Blog

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

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

New Features

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

License

MIT ©

This project based on transitivebullsh.it.

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