Convert notion data into Markdown and automatically push and create pull request. This should work with markdown-based static site generators like Gridsome or hugo etc. (I use this on gridsome and Cloudflare Pages)
- Your site can be generated by static site generators
- PR-based CICD pipeline such as Cloudflare Pages
Setup your Notion database.
# install dependencies
yarn
# create dotenv file from example
cp .env.example .env
# modify .env according to your environment
vim .env
yarn app-runIf updated detected, PR will be created
DATABASE_ID: Your Notion database idPROP_NAME_PERMALINK: Property name of permalink in your databasePROP_NAME_TAG: Property name of tag in your databasePROP_NAME_CATEGORY: Property name of category in your databasePROP_NAME_INCLUDE: Property name of include in your database. This tool convert the page with it turned ONPROP_NAME_EXCLUDE: Property name of exclude checkbox in your database. This tool DOES NOT convert the page with it turned ONGITHUB_REPO: Github repository url of your blogGITHUB_PAT: Github personal access tokenNOTION_TOKEN: Notion tokenBLOG_ASSET_DIR: Asset directory path from your blog repository's root path. It used as directory path of downloaded image path as below:
# Just after converting from Notion page data into markdown, the image path still points to Notion's S3 bucket.

# This tool downloads images and replaces image paths to local image path.
BLOG_POST_DIR: Post directory path from your blog repository's root path likecontent/posts


