From eb0a2e152920a01e6eaa4e98f41ea4fd504b0c47 Mon Sep 17 00:00:00 2001 From: ginifizz Date: Tue, 17 Oct 2023 16:13:37 +0200 Subject: [PATCH] fix: try to fix fonts url --- utils/clone-documentation.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/clone-documentation.js b/utils/clone-documentation.js index 2d4f90d..dc51677 100644 --- a/utils/clone-documentation.js +++ b/utils/clone-documentation.js @@ -17,7 +17,13 @@ async function cloneDocumentation() { await fs.copySync('tempRepo/README.md', `${rootPath}/docs/README.md`); await fs.copySync('tempRepo/spec', `${rootPath}/spec`); await fs.copySync('tempRepo/schemas', `${rootPath}/public/img/schemas`); + fs.removeSync('tempRepo'); + + // update css + const data = fs.readFileSync(`${rootPath}/styles/fonts.css`, 'utf8'); + const modifiedData = data.replace(new RegExp('/fonts/', 'g'), `${process.env.NEXT_PUBLIC_BASE_URL || ''}/fonts/`); + fs.writeFileSync(`${rootPath}/styles/fonts.css`, modifiedData, 'utf8'); } catch (error) { console.error(error); }