From 3bfb6ebe1d65f4a489015549f003226d70cc90ab Mon Sep 17 00:00:00 2001 From: Freddy Robinson Date: Fri, 17 Feb 2023 22:40:51 +0000 Subject: [PATCH] Preview relative links --- index.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.mjs b/index.mjs index f1c7eae..b28c17a 100644 --- a/index.mjs +++ b/index.mjs @@ -335,7 +335,7 @@ async function savePageAndResources(url, html, $) { // write preview index page const dir = `${output}/preview${url}` ensureDirExists(dir) - html = html.replace(regexEmail, 'Licensed User').replace('', '\n') + html = html.replace(regexEmail, 'Licensed User').replace('', '\n').replace(/(src|href)="\//g, '$1="./') fs.writeFileSync(`${dir}/index.html`, html) console.log(`📝 Writing ${url}/index.html`) }