My customization of NotionX's react-notion-x. Personal use only!
You have to install Tailwind CSS 6144 a> in your project.
Install this repo as a submodule in your project under the root folder.
curl -fsSL https://bun.sh/install | bash # Install Bun
bun i -g rimraf
# first install only
git submodule add https://github.com/namnh198/notion-x.git
# in case your repo has already added this repo as a submodule
# and this is the first time you clone your repo to local
git submodule update --init --recursive
# to update submodule
git submodule update --recursive --remote
You have to install the packages lised in package.json
for both "dependencies"
and "devDependencies"
.
You have to have following environment variables (put them in .env.local
),
NOTION_TOKEN = "secret_xxx"
NOTION_VERSION = "2022-06-28"
# For Unofficial Posts DB
NOTION_API_WEB = "https://www.notion.so/api/v3"
SPACE_ID = "xxx"
SOURCE_ID = "xxx"
COLLECTION_VIEW_ID = "xxx"
# "dev" or "prod"
ENV_MODE = "dev"
Put in your tsconfig.json
,
"compilerOptions": {
"paths": {
"@/*": ["./*"],
"@notion-x/*": ["./notion-x/src/*"]
}
}
Put below line in tailwind.config.ts
,
{
content: ['./notion-x/**/*.{js,ts,jsx,tsx,mdx,css,scss}']
}