From 742a5fb0e994ebcd24824c755d4ef2367f06827f Mon Sep 17 00:00:00 2001 From: Julian Bogdani Date: Tue, 19 Sep 2023 18:42:44 +0200 Subject: [PATCH] Solves #31 (#32) * Solves #31 * 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 813728d..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,