PRELUDE

How to use NotionPage

This guide is meant to help you generate a static site with Notion.

0. P rerequisites

1. Clone Repo

If you already know how to use git, then clone this repo:


https://github.com/imyangmo/notionpaper.git

If you don’t, go to this page , then download this repo as a compressed file, then decompress it to a folder.

2. Prepare the environment

Go to the folder that you cloned / decompressed, run:


pip install -r requirements.txt

3. Apply for Notion Intergrations

Go to https://www.notion.so/my-integrations , click “New Intergration” button, specify the “Name” and “Associated Workplace” (where you keep your contents), the click submit.

An internal intergration is okay to use.

After that, you will see a “Secrets” section, click “Show”, then copy that token to a place where is safe.

4. Setup a Notion database

Go to the workplace where your intergration was associated,

  1. Create a new empty page, then create a block as a full page database
  2. Fill up the page title, where will be used as your site name
  3. Besides “Name” and “Tags” column, add three more columns as:

Final table looks like this:

Remeber the page id, in url looks like this (the string after “ notion.so/ ” and before “ ?v= ”):

5. Setup the configuration file

Go to your folder, open “ config.yml ” with any text editor:

  1. Proxy: enable it if you are in some area where accessing Notion might be disrupted
  2. toc_id: the page id of your database where you get from step 4
  3. notion_token: the token you get from step 3

6. Run the script

Inside the folder, run:


python ./index.py

7. Deploy

If everything went great, you will find your site at “/public” folder.

Now you could deploy your site to any hosting services now.