GitHub - emma2334/notion-paging-helper: Add prev and next buttons to each subpage

Demo

Usage

Setup integration

Setup integration and invite it to your page.

截圖 2021-10-20 下午7.52.03.png

Run the script

Clone the project to your computer and export the Internal Integration Token which generated in the former step.

# Setup project
$ git clone [email protected]:emma2334/notion-paging-helper.git
$ npm i

# Set token as an environment variable
$ export NOTION_KEY=secret_...

# Run
$ node index.js
[Configuration] # Only show in first time
Notion key: secret_...
Would you like change button wording? [y/n]: y
"← Prev": 上一篇
"Next →": 下一篇

Page ID: [edebb5fcb6fd4e9ba36ee7f1191ade70](<https://emma-chung.notion.site/Paging-demo-a9e27522eaf34b7f856c737ffea175b7>)  # Click the id to check demo
Does paging go with title under each link? [y/N] y

Apply to all pages under the target

The target could be a page or a block.

$ node index.js
$ node index.js all

Only apply to specific page

<aside> ⚠️ The page should be the one which is directly under a page instead of a block.

</aside>

$ node index.js single

Config.json

Though the script will create one if config.json isn't found. You still can write it by yourself, and it allows you to use multiple keys.