diff --git a/scripts/pds-logo.svg b/scripts/pds-logo.svg new file mode 100644 index 0000000..67c4372 --- /dev/null +++ b/scripts/pds-logo.svg @@ -0,0 +1,5 @@ + +pds.js + + + diff --git a/scripts/publish-worker-artifact.mjs b/scripts/publish-worker-artifact.mjs index b3458e8..196bd59 100644 --- a/scripts/publish-worker-artifact.mjs +++ b/scripts/publish-worker-artifact.mjs @@ -132,16 +132,25 @@ function formatSize(bytes) { return `${(bytes / 1024 / 1024).toFixed(1)} MB`; } +// The project mark, inlined for the header and published as a file for the +// favicon. The letters are outlines, so the mark does not depend on the +// viewer's fonts. +const logoSvg = readFileSync(join(repoRoot, 'scripts', 'pds-logo.svg'), 'utf8'); +const logoInline = logoSvg.replace( + 'width="630" height="630"', + 'width="48" height="48"', +); + const indexHtml = ` pds.js worker artifacts + -pds +${logoInline}

Cloudflare worker artifacts

@@ -185,6 +194,10 @@ const releasesBlob = await uploadBlob( new TextEncoder().encode(JSON.stringify(releases, null, 2)), 'application/json', ); +const logoBlob = await uploadBlob( + new TextEncoder().encode(logoSvg), + 'image/svg+xml', +); const IMMUTABLE = 'public, max-age=31536000, immutable'; const SHORT = 'public, max-age=300'; @@ -199,6 +212,7 @@ const entries = [ { path: 'latest/manifest.json', blob: manifestBlob, cacheControl: SHORT }, { path: 'index.html', blob: indexBlob, cacheControl: SHORT }, { path: 'releases.json', blob: releasesBlob, cacheControl: SHORT }, + { path: 'logo.svg', blob: logoBlob, cacheControl: SHORT }, ]; const replaced = new Set(entries.map((e) => e.path)); const files = [
versionpublishedsize