Skip to content

Commit 31528e3

Browse files
author
Sergei Orlov
committed
💥 Remove image transformation
It should be done separately per project
1 parent 804d4c9 commit 31528e3

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

gatsby-node.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,9 @@ const { notionBlockToMarkdown } = require("./src/transformers/notion-block-to-ma
33
const { getNotionPageProperties } = require("./src/transformers/get-page-properties")
44
const { getNotionPageTitle } = require("./src/transformers/get-page-title")
55
const YAML = require("yaml")
6-
const { createRemoteFileNode } = require("gatsby-source-filesystem")
76

87
const NOTION_NODE_TYPE = "Notion"
98

10-
exports.onCreateNode = async ({ node, actions: { createNode }, createNodeId, getCache }) => {
11-
if (node.internal.type == NOTION_NODE_TYPE) {
12-
const filesPropertyKey = Object.keys(node.properties).find(
13-
(key) => node.properties[key].type == "files",
14-
)
15-
16-
if (filesPropertyKey) {
17-
for (let i = 0; i < node.properties[filesPropertyKey].value.length; i++) {
18-
const name = node.properties[filesPropertyKey].value[i].name
19-
20-
if (name.startsWith("http")) {
21-
const fileNode = await createRemoteFileNode({
22-
url: name,
23-
parentNodeId: node.id,
24-
createNode,
25-
createNodeId,
26-
getCache,
27-
})
28-
29-
if (fileNode) {
30-
node.properties[filesPropertyKey].value[i].remoteImage___NODE = fileNode.id
31-
}
32-
}
33-
}
34-
}
35-
}
36-
}
37-
389
exports.sourceNodes = async (
3910
{ actions, createContentDigest, createNodeId, reporter },
4011
{ token, databaseId, propsToFrontmatter = true, lowerTitleLevel = true },

0 commit comments

Comments
 (0)