From a85b958e1d9890cf79dbc28f086d126878581eca Mon Sep 17 00:00:00 2001 From: shum Date: Fri, 10 Jul 2026 09:40:19 +0000 Subject: [PATCH] website: fix broken GitHub links for project files in docs --- website/.eleventy.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/website/.eleventy.js b/website/.eleventy.js index 122e5bb673..e90ac373a0 100644 --- a/website/.eleventy.js +++ b/website/.eleventy.js @@ -440,10 +440,9 @@ module.exports = function (ty) { if (fs.existsSync(linkFile)) { // this condition works if the link is a valid project file const githubUrl = "https://github.com/simplex-chat/simplex-chat/blob/stable" - const keyword = "/simplex-chat" - index = linkFile.indexOf(keyword) - linkFile = linkFile.substring(index + keyword.length) - parsed.path = `${githubUrl}${linkFile}` + const repoRoot = hostFile.slice(0, hostFile.indexOf('/website/src')) + const repoPath = linkFile.slice(repoRoot.length) + return `${githubUrl}${repoPath}` } else { // if the link is not a valid website file or project file throw new Error(`Broken link: ${parsed.path} in ${hostFile}`)