gatsby-source-notion-churnotion 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -2
- package/package.json +2 -2
package/README.md
CHANGED
@@ -1,3 +1,89 @@
|
|
1
|
-
#
|
1
|
+
# gatsby-source-notion-churnotion
|
2
2
|
|
3
|
-
|
3
|
+
Gatsby plugin to connect with a Notion database recursively using the official API.
|
4
|
+
|
5
|
+
This plugin recursively collects categories from a single Notion database, which can be used as a CMS for your blog. It ultimately creates a Churnotion node that converts the components of a Notion page into MDX components and stores them in JSON format.
|
6
|
+
|
7
|
+
If you're considering Notion as your CMS for Gatsby, this plugin could be a great choice as it supports recursive category collection.
|
8
|
+
|
9
|
+
## Install
|
10
|
+
|
11
|
+
```shell
|
12
|
+
npm install gatsby-source-notion-churnotion
|
13
|
+
```
|
14
|
+
|
15
|
+
```shell
|
16
|
+
yarn add gatsby-source-notion-churnotion
|
17
|
+
```
|
18
|
+
|
19
|
+
## How to use
|
20
|
+
You need to set the following environment variables:
|
21
|
+
|
22
|
+
GATSBY_INTEGRATION_TOKEN
|
23
|
+
GATSBY_DATABASE_ID
|
24
|
+
To get the integration token, set it up in your Notion database, and find the database ID, refer to the official [Notion Integration Guide](https://developers.notion.com/docs/create-a-notion-integration).
|
25
|
+
### 환경변수 설정
|
26
|
+
```.env:title=.env
|
27
|
+
GATSBY_INTEGRATION_TOKEN={Your Notion API Integration Token}
|
28
|
+
GATSBY_DATABASE_ID={Your Notion Database ID}
|
29
|
+
```
|
30
|
+
|
31
|
+
### gatsby-config.ts / gatsby-config.js 추가
|
32
|
+
|
33
|
+
```ts:title=gatsby-config.ts
|
34
|
+
const config: GatsbyConfig = {
|
35
|
+
plugins: [
|
36
|
+
{
|
37
|
+
resolve: `gatsby-source-notion-churnotion`,
|
38
|
+
options: {
|
39
|
+
token: process.env.GATSBY_INTEGRATION_TOKEN,
|
40
|
+
databaseId: process.env.GATSBY_DATABASE_ID,
|
41
|
+
},
|
42
|
+
},
|
43
|
+
],
|
44
|
+
};
|
45
|
+
```
|
46
|
+
|
47
|
+
### Run Development Server
|
48
|
+
```shell
|
49
|
+
npm run develop
|
50
|
+
```
|
51
|
+
|
52
|
+
```shell
|
53
|
+
yarn develop
|
54
|
+
```
|
55
|
+
|
56
|
+
```shell
|
57
|
+
gatsby develop
|
58
|
+
```
|
59
|
+
|
60
|
+
When the development server is running, `gatsby-source-notion-churnotion` will fetch categories and pages from your Notion database using the official Notion API.
|
61
|
+
|
62
|
+
|
63
|
+

|
64
|
+
|
65
|
+
### Explore in GraphQL
|
66
|
+
|
67
|
+
Once the data is fetched, go to http://localhost:8000/__graphql, where you’ll find new nodes such as `Churnotion`, `NBook`, `NCategory`, and `NTag` as shown below:
|
68
|
+
|
69
|
+

|
70
|
+
|
71
|
+
### Example Query
|
72
|
+
|
73
|
+
Use the following GraphQL query to explore the `Churnotion` node:
|
74
|
+
|
75
|
+
```gql
|
76
|
+
query MyQuery {
|
77
|
+
allChurnotion {
|
78
|
+
nodes {
|
79
|
+
id
|
80
|
+
content
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
```
|
85
|
+
|
86
|
+
This will return results in MDX format, as shown below:
|
87
|
+
|
88
|
+
|
89
|
+

|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "gatsby-source-notion-churnotion",
|
3
3
|
"description": "Gatsby plugin that can connect with One Notion Database RECURSIVELY using official API",
|
4
|
-
"version": "1.0.
|
4
|
+
"version": "1.0.1",
|
5
5
|
"skipLibCheck": true,
|
6
6
|
"license": "0BSD",
|
7
7
|
"main": "./dist/gatsby-node.js",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"recursive"
|
25
25
|
],
|
26
26
|
"author": "Churnobyl <tjdcjfals3@naver.com> (https://github.com/Churnobyl)",
|
27
|
-
"homepage": "https://
|
27
|
+
"homepage": "https://churnobyl.com",
|
28
28
|
"repository": {
|
29
29
|
"type": "git",
|
30
30
|
"url": "git+https://github.com/Churnobyl/gatsby-source-notion-churnotion"
|