From d2312cf7909b9627417eee77002dfba9af3a19b9 Mon Sep 17 00:00:00 2001 From: Tobias Date: Sun, 8 Dec 2024 17:22:12 +0100 Subject: [PATCH 1/2] Fix edit link when repositoryURL does not end in `/` --- smooth-doc/gatsby-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smooth-doc/gatsby-node.js b/smooth-doc/gatsby-node.js index c90efd9..34f7b73 100644 --- a/smooth-doc/gatsby-node.js +++ b/smooth-doc/gatsby-node.js @@ -140,7 +140,7 @@ function onCreateMdxNode({ node, getNode, actions }, options) { baseDirectory, '', ) - return `${repositoryURL}edit/${githubDefaultBranch}${relativePath}` + return new URL(`edit/${githubDefaultBranch}${relativePath}`, repositoryURL).toString() } createNodeField({ From dfbd2dd5a1aeb6c0aac9be27f211a7101f9d0d80 Mon Sep 17 00:00:00 2001 From: Tobias Date: Sun, 8 Dec 2024 17:24:46 +0100 Subject: [PATCH 2/2] Add missing `blob/` to edit link --- smooth-doc/gatsby-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smooth-doc/gatsby-node.js b/smooth-doc/gatsby-node.js index 34f7b73..de15ea9 100644 --- a/smooth-doc/gatsby-node.js +++ b/smooth-doc/gatsby-node.js @@ -140,7 +140,7 @@ function onCreateMdxNode({ node, getNode, actions }, options) { baseDirectory, '', ) - return new URL(`edit/${githubDefaultBranch}${relativePath}`, repositoryURL).toString() + return new URL(`blob/edit/${githubDefaultBranch}${relativePath}`, repositoryURL).toString() } createNodeField({