Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-source-notion-contents

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-source-notion-contents - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

14

gatsby-node.js

@@ -5,2 +5,10 @@ "use strict";

const formatUid = uid => {
if (uid.indexOf('-') === -1) {
return `${uid.slice(0, 8)}-${uid.slice(8, 12)}-${uid.slice(12, 16)}-${uid.slice(16, 20)}-${uid.slice(20)}`;
}
return uid;
};
const getSources = async ({

@@ -16,3 +24,7 @@ actions: {

const notion = new Notion(options.token);
const notion = new Notion(options.token, {
prefix: options.prefix,
removeStyle: options.removeStyle
});
const hydratedIds = (options.ids || []).map(formatUid);
const pageIds = (await notion.getPageIds()).concat(options.ids || []);

@@ -19,0 +31,0 @@ const pages = await Promise.all(pageIds.map(async id => {

4

package.json
{
"name": "gatsby-source-notion-contents",
"version": "1.0.11",
"version": "1.0.12",
"description": "Get gatsby sources from notion",

@@ -29,3 +29,3 @@ "main": "index.js",

"@babel/runtime": "^7.7.7",
"get-notion-contents": "^2.1.2"
"get-notion-contents": "^2.1.3"
},

@@ -32,0 +32,0 @@ "devDependencies": {

@@ -16,2 +16,18 @@ # gatsby-source-notion-contents

## Options
```ts
type Option = {
token: string; // Required
ids?: string[]; // Optional. To get contents that are out of scope.
prefix?: string; // Optional. to add prefix into relative links
removeStyle?: boolean; // Optional. to remove inline styles
};
```
__ids__
If the URL is `https://www.notion.so/Personal-Home-db45cd2e7c694c3493c97f2376ab184a`,
You need to add `db45cd2e7c694c3493c97f2376ab184a` into `options.ids`.
## How to use

@@ -29,2 +45,4 @@ ```js

ids: ['<<ID_OF_NOTION_PAGE>>'],
prefix: '/',
removeStyle: false,
},

@@ -36,6 +54,2 @@ },

If the URL is `https://www.notion.so/Personal-Home-db45cd2e7c694c3493c97f2376ab184a`,
You need to add `db45cd2e7c694c3493c97f2376ab184a` into `options.ids`.
(⚠️ `ids` is optional. but it **should** be array.)
## How to query

@@ -42,0 +56,0 @@ - Get all posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc