Skip to content

Commit ee2edea

Browse files
thebuilderclaude
andcommitted
Add the tiled package icon and tidy the OG footer
Composite the high-res mark onto a dark 512px rounded tile for the NuGet and Umbraco Marketplace package icon (icon.png), replacing the old 128px one; a filled tile stays legible on light and dark listing surfaces. scripts/generate-icon.mjs regenerates it. Drop the redundant 'Vercel . Plausible' line from the OG card (both are already named in the tagline) and left-align the URL with the rest of the card. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ad6dce5 commit ee2edea

4 files changed

Lines changed: 53 additions & 3 deletions

File tree

-2.12 KB
Loading
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Generates the NuGet / Umbraco Marketplace package icon at the repo root
2+
// (icon.png, 512x512) by compositing the transparent product mark onto a dark
3+
// rounded tile. A filled tile keeps the icon legible on the light and dark
4+
// listing surfaces NuGet and the Marketplace render it on, unlike a bare
5+
// transparent mark. Run after changing the mark:
6+
//
7+
// node scripts/generate-icon.mjs
8+
//
9+
import { readFile, writeFile } from "node:fs/promises";
10+
import { fileURLToPath } from "node:url";
11+
import { dirname, resolve } from "node:path";
12+
import sharp from "sharp";
13+
14+
const here = dirname(fileURLToPath(import.meta.url));
15+
const docsRoot = resolve(here, "..");
16+
const repoRoot = resolve(docsRoot, "../..");
17+
18+
const SIZE = 512;
19+
const RADIUS = 114; // ~22% rounded square
20+
const MARK = 424; // mark size within the tile
21+
const inset = Math.round((SIZE - MARK) / 2);
22+
23+
const tileSvg = `<svg width="${SIZE}" height="${SIZE}" viewBox="0 0 ${SIZE} ${SIZE}" xmlns="http://www.w3.org/2000/svg">
24+
<defs>
25+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
26+
<stop offset="0" stop-color="#15152E"/>
27+
<stop offset="1" stop-color="#08080F"/>
28+
</linearGradient>
29+
<radialGradient id="glow" cx="0.5" cy="0.02" r="0.9">
30+
<stop offset="0" stop-color="#6D5EF7" stop-opacity="0.38"/>
31+
<stop offset="0.55" stop-color="#3B82F6" stop-opacity="0.08"/>
32+
<stop offset="1" stop-color="#3B82F6" stop-opacity="0"/>
33+
</radialGradient>
34+
</defs>
35+
<rect x="0" y="0" width="${SIZE}" height="${SIZE}" rx="${RADIUS}" ry="${RADIUS}" fill="url(#bg)"/>
36+
<rect x="0" y="0" width="${SIZE}" height="${SIZE}" rx="${RADIUS}" ry="${RADIUS}" fill="url(#glow)"/>
37+
</svg>`;
38+
39+
const tile = await sharp(Buffer.from(tileSvg)).png().toBuffer();
40+
41+
const mark = await sharp(await readFile(resolve(docsRoot, "public/web-analytics.png")))
42+
.resize(MARK, MARK, { fit: "contain", background: { r: 0, g: 0, b: 0, alpha: 0 } })
43+
.png()
44+
.toBuffer();
45+
46+
const out = await sharp(tile)
47+
.composite([{ input: mark, top: inset, left: inset }])
48+
.png()
49+
.toBuffer();
50+
51+
await writeFile(resolve(repoRoot, "icon.png"), out);
52+
console.log(`wrote icon.png (${SIZE}x${SIZE})`);

‎apps/docs/scripts/generate-og.mjs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const taglineLines = [
3131
"Vercel Web Analytics and Plausible reports,",
3232
"right inside the Umbraco backoffice.",
3333
];
34-
const providers = "Vercel • Plausible";
3534
const url = "umbraco-web-analytics.vercel.app";
3635
const font = "'Inter', 'Helvetica Neue', Arial, sans-serif";
3736

@@ -64,8 +63,7 @@ const svg = `<svg width="${WIDTH}" height="${HEIGHT}" viewBox="0 0 ${WIDTH} ${HE
6463
<text x="82" y="452" font-family="${font}" font-size="34" font-weight="400" fill="#A7ADC0">${esc(taglineLines[0])}</text>
6564
<text x="82" y="498" font-family="${font}" font-size="34" font-weight="400" fill="#A7ADC0">${esc(taglineLines[1])}</text>
6665
67-
<text x="82" y="566" font-family="${font}" font-size="26" font-weight="600" fill="#6E7789">${esc(providers)}</text>
68-
<text x="${WIDTH - 80}" y="566" text-anchor="end" font-family="${font}" font-size="24" font-weight="500" fill="#5B6274">${esc(url)}</text>
66+
<text x="82" y="566" font-family="${font}" font-size="26" font-weight="500" fill="#6E7789">${esc(url)}</text>
6967
</svg>`;
7068

7169
await mkdir(resolve(root, "public"), { recursive: true });

‎icon.png‎

211 KB
Loading

0 commit comments

Comments
 (0)