From d2c801deceb847efff00a04db8f5c8eec0e06215 Mon Sep 17 00:00:00 2001 From: Julian Bogdani Date: Tue, 29 Aug 2023 23:09:16 +0200 Subject: [PATCH 1/2] Solves #31 --- gatsby-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatsby-node.js b/gatsby-node.js index 813728d..4321c42 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -90,7 +90,7 @@ exports.sourceNodes = async (gatsbyOptions, pluginOptions) => { const nameParts = file.filename_download.split('.'); const ext = nameParts.length > 1 ? `.${nameParts.pop()}` : ''; const name = nameParts.join('.'); - const fileUrl = `${plugin.url}assets/${file.id}`; + const fileUrl = `${plugin.url}/assets/${file.id}`; const fileNode = await createRemoteFileNode({ url: fileUrl, parentNodeId: file.id, From 5764eeb304c79602b2e8ccc856c354d10e2e49e6 Mon Sep 17 00:00:00 2001 From: Julian Bogdani Date: Thu, 7 Sep 2023 05:08:27 +0200 Subject: [PATCH 2/2] A cleaner solution to solve #31 --- gatsby-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatsby-node.js b/gatsby-node.js index 4321c42..3eff68f 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -90,7 +90,7 @@ exports.sourceNodes = async (gatsbyOptions, pluginOptions) => { const nameParts = file.filename_download.split('.'); const ext = nameParts.length > 1 ? `.${nameParts.pop()}` : ''; const name = nameParts.join('.'); - const fileUrl = `${plugin.url}/assets/${file.id}`; + const fileUrl = `${plugin.url}${plugin.url.endsWith('/') ? '' : '/'}assets/${file.id}`; const fileNode = await createRemoteFileNode({ url: fileUrl, parentNodeId: file.id,