gatsby-source-notion-churnotion 1.0.25 → 1.0.27

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.
@@ -16,7 +16,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
16
16
  * @param databaseId 데이터베이스 아이디
17
17
  * @param parentCategoryId 부모 데이터베이스 아이디
18
18
  */
19
- const processDatabase = async (databaseId, parentCategoryId = null, categoryPath = [], tagMap = {}, categoryUrl = ``) => {
19
+ const processDatabase = async (databaseId, parentCategoryId = null, categoryPath = [], tagMap = {}, parentCategoryUrl = ``) => {
20
20
  let hasMore = true;
21
21
  try {
22
22
  while (hasMore) {
@@ -39,7 +39,7 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
39
39
  reporter.warn(`[WARNING] Category without a title detected: ${categoryJsonData.id}`);
40
40
  }
41
41
  const nodeId = createNodeId(`${categoryJsonData.id}-category`);
42
- categoryUrl += `/${slug}`;
42
+ const categoryUrl = `${parentCategoryUrl}/${slug}`;
43
43
  const categoryNode = {
44
44
  id: nodeId,
45
45
  category_name: title,
@@ -156,9 +156,8 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
156
156
  },
157
157
  tags: tagIds,
158
158
  parent: null,
159
- url: `${constants_1.COMMON_URI}/${constants_1.POST_URI}${categoryUrl}/${slug}`,
159
+ url: `${constants_1.COMMON_URI}/${constants_1.POST_URI}${parentCategoryUrl}/${slug}`,
160
160
  thumbnail: imageNode,
161
- ...gatsbyImageData,
162
161
  };
163
162
  await createNode(postNode);
164
163
  // book과 post 부모-자식 관계 설정
@@ -1,3 +1,3 @@
1
1
  import { Actions, GatsbyCache, Reporter } from "gatsby";
2
2
  import { MdBlock } from "notion-to-md/build/types";
3
- export declare const processBlocks: (blocks: MdBlock[], actions: Actions, getCache: (this: void, id: string) => GatsbyCache, createNodeId: (this: void, input: string) => string, reporter: Reporter) => Promise<import("gatsby-source-filesystem").FileSystemNode | null>;
3
+ export declare const processBlocks: (blocks: MdBlock[], actions: Actions, getCache: (this: void, id: string) => GatsbyCache, createNodeId: (this: void, input: string) => string, reporter: Reporter) => Promise<string | null>;
@@ -24,7 +24,7 @@ const processBlocks = async (blocks, actions, getCache, createNodeId, reporter)
24
24
  if (fileNode) {
25
25
  block.parent = fileNode.id;
26
26
  if (!thumbnail)
27
- thumbnail = fileNode;
27
+ thumbnail = fileNode.id;
28
28
  reporter.info(`[SUCCESS] Image processed: ${fileNode.id}`);
29
29
  }
30
30
  }
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.25",
4
+ "version": "1.0.27",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",