Notion source for Gridsome.
Warning: This plugin is experimental, use at your own risk.
npm install gridsome-source-notion
yarn add gridsome-source-notion
module.exports = {
plugins: [
{
use: "gridsome-source-notion",
options: {
notionKey: "YOUR_NOTION_INTEGRATION_KEY",
notionToken: "YOUR_NOTION_USER_TOKEN",
databaseId: "YOUR_DATABASE_ID",
typeName: "Post"
},
},
],
transformers: {
remark: {
externalLinksTarget: "_blank",
externalLinksRel: ["nofollow", "noopener", "noreferrer"],
plugins: ["@gridsome/remark-prismjs"],
},
},
};
You'll first need to create an integration with Notion's API. The full process is detailed here.
You'll then need to create a new database to use for your blog. We suggest creating a table or list view as those will be the easiest to manage inside Notion.
Important: You'll need to share your newly created database with your integration or the plugin won't be able to find your pages.
notionKey
: Your integration secret key.databaseId
: The ID of the database you want to use withtokenId
: This plugin currently usesnotion-exporter
under the hood to retrieve Markdown exports of your pages, and as such uses an internal API which doesn't use the notion integration key. You'll need to follow this document to obtain a token ID for your account.