Notion Blog React Documentation
What is this
Notion Blog React is a Blog powered by Notion, built with React, Next.JS, tailwindcss, TypeScript, Notion-Api-Worker and more.
TL;DR
- Fork the Notion Blog React from GitHub.
- Change setting in
config/site.config.js
file. - Import to Vercel by clicking this quick link.
- Add two environment variables
NOTION_API
andNOTION_TABLE_SLUG
to Vercel configuration. - Deploy it.
You can now visit the link generated by Vercel.
Complete Deployment Guide
If you are interested in this project, you can have a try it by using the doing the following things.
To do the following, you need to have GitHub account ready.
Fork this project
Visiting Notion Blog React on GitHub, and click the fork
on the top right.
Change the site configuration
Enter config/site.config.js
, change the configuration.
See details about the each variable
Notion API Preparation
This will be one of the Environment Variable of your site, called NOTION_API
.
Please do not add http://
or https://
before NOTION_API
.
You can use notion-api.splitbee.io
if you don't want to make your own one.
Alternatively, see here for how to deploy a notion-api by yourself.
Create the Database in Notion
This will be one of the Environment Variable of your site, called NOTION_TABLE_SLUG
.
You should create a notion table with below properties. (You can duplicate a template from here.)
See details about the each property
Please don't leave blank in any property box, excepted checkbox and description.
An error will happen if you do so.
Deploy on Serverless platform
We have now finished the large part of configuration, it is time to deploy it.
You can choose to deploy it on any serverless which support Next.JS framework, we recommend Vercel, you can use Netlify, etc.
Please don't use Cloudflare Pages, they only support Next.JS Static Deploy at the moment.
-
To deploy it on Vercel, visit Vercel and click the New Project button.
-
Import your forked repository.
This is how configuration looks like.
It is important to add the
Environment Variables
, else, the deployment will fail. -
After all setup, click Deploy.
-
You can visit your website via Vercel auto-generated URL (If you deploy with Vercel, it should ending with
vercel.app
).
Deploy it locally
We have now finished the large part of configuration, it is time to deploy it.
You can download your whole project by clicking the Download ZIP on your GitHub, or you can clone it if you prefer to do so.
After that, please do the following things:
-
Open your project in an IDE, such as VSCode, or terminal, such as iterm2.
-
Create a
.env.local
in the root path of the project. -
Copy and paste from
.env.example
to.env.local
. -
Fill in the environment variables in
.env.local
.It is important to add the
Environment Variables
, else, the deployment will fail. -
Run
yarn
in your project. -
Run
yarn build && yarn start
in your project. -
You can now able to visit your website via
http://localhost:3000
.