diff --git a/deploy b/deploy index 2010d63..eb5f52f 100755 --- a/deploy +++ b/deploy @@ -1,5 +1,5 @@ #!/bin/bash rm -rf dist && nr build -curl https://deploy.arm.adam.id.au/client.mjs > /tmp/client.mjs +curl -q https://deploy.arm.adam.id.au/client.mjs > /tmp/client.mjs DEPLOY_PATH=dist DEPLOY_PROJECT=homepage DEPLOY_CADDYFILE=Caddyfile node /tmp/client.mjs diff --git a/src/build.js b/src/build.js index 22398d9..63b7ec6 100644 --- a/src/build.js +++ b/src/build.js @@ -33,12 +33,7 @@ for (const [name, f] of Object.entries(fonts)) { const words = typeof selector === 'string' ? Array.from(doc.querySelectorAll(selector)).map(x => x.textContent).join(' ') : selector(); const subset = await subsetFont(await readFile(path), words, { targetFormat: 'woff2' }); - const hash = makeHash(subset); - - const outName = `static/${name}-${weight}.${hash}.woff2`; - - html = html.replace(`FONT_${name}_${weight}`, outName); - await writeFile('dist/' + outName, subset); + html = html.replace(`FONT_${name}_${weight}`, 'data:font/woff2;base64,' + subset.toString('base64')); } }