使用Notion搭建个人博客

date
Apr 29, 2023
slug
notion-blog
status
Published
tags
Website
summary
本文介绍了如何使用Notion搭建个人博客。
type
Post

1. 搭建Notion数据库

打开 https://github.com/craigary/nobelium,找到 README.md 中的 Quick Start,打开 Duplicate this Notion template, and share it to the public 中的链接,将该Notion模板复制到自己的Notion中:
notion image
然后打开共享:
notion image
同时复制 Page ID,在后续步骤会用到:
notion image

2. 搭建GitHub仓库

克隆 https://github.com/craigary/nobelium 项目。注意:所使用的 GitHub 账号,绑定的邮箱最好是 Gmail,否则在第3步的 Sign Up 时可能会提示如下错误:
notion image

3. 部署到Vercel

打开 https://vercel.com/,点击 Sign Up,选择 Continue with GitHub,然后 Import Git Repository,选择在第2步中 fork 的 Nobelium 项目。在 Environment Variables 中添加一个环境变量,NAME 为 NOTION_PAGE_ID,VALUE 为第1步中的 Page ID,然后部署即可:
notion image

4. 开始写博客

在写文章时,文章的如下字段必须正确填写,否则不会同步到博客网站上。
notion image
字段解释如下:
  • date:博客显示的时间。
  • slug:决定了博客的地址,比如填写的是 notion-blog,这篇文章的显示地址就为:https://xxx/notion-blog
  • status:只有为 Published 的文章才会显示在博客界面上。Idea、Draft、Revise 分别表示点子、手稿和修改状态。
  • tags:文章的标签。
  • summary:文章摘要,显示在博客首页。
  • type:文章显示类型,一般选择 Post。

© jiangling 2021 - 2025