diff --git a/scripts/build.mjs b/scripts/build.mjs index e215d7e..b1d7bfd 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -43,6 +43,8 @@ const stylesheet = new CleanCSS({level:2, rebase:false}).minify(stylesheetSource if (stylesheet.errors.length) throw new Error(stylesheet.errors.join('\n')); const logo = await readFile(new URL('../src/logo.webp', import.meta.url)); const logoPath = `/assets/logo.${createHash('sha256').update(logo).digest('hex').slice(0,12)}.webp`; +const nav = (await minify(await readFile(new URL('../src/nav.js', import.meta.url), 'utf8'), {module:true})).code; +const navPath = `/assets/nav.${createHash('sha256').update(nav).digest('hex').slice(0,12)}.js`; const aiClient = (await minify(await readFile(new URL('../src/ai-client.js', import.meta.url), 'utf8'), {module:true})).code; const aiClientPath = `/assets/ai-client.${createHash('sha256').update(aiClient).digest('hex').slice(0,12)}.js`; const aiPanelSource = (await readFile(new URL('../src/ai-panel.js', import.meta.url), 'utf8')).replace("'./ai-client.js'", JSON.stringify(aiClientPath)); @@ -175,18 +177,20 @@ function document({ title, description, path, content, current, noindex = false + ${current ? `` : ''} -