diff --git a/website/content/logo.de.md b/website/content/logo.de.md index fe820ad..b658664 100644 --- a/website/content/logo.de.md +++ b/website/content/logo.de.md @@ -5,6 +5,7 @@ translationKey: "logo" layout: single type: poll poll: logo +image: /img/logo/vote-card.png sitemap: priority: 0.5 m: diff --git a/website/content/logo.md b/website/content/logo.md index 7091e93..721b96d 100644 --- a/website/content/logo.md +++ b/website/content/logo.md @@ -6,6 +6,7 @@ url: /logo/ layout: single type: poll poll: logo +image: /img/logo/vote-card.png sitemap: priority: 0.5 m: diff --git a/website/layouts/partials/head.html b/website/layouts/partials/head.html index 546d8f9..4c83b53 100644 --- a/website/layouts/partials/head.html +++ b/website/layouts/partials/head.html @@ -11,6 +11,10 @@ +{{ with .Params.image }} + + +{{ end }} {{ $parts := split .Site.Language.LanguageCode "-" }} {{ range .AllTranslations }} diff --git a/website/static/img/logo/vote-card.png b/website/static/img/logo/vote-card.png new file mode 100644 index 0000000..55cb6d7 Binary files /dev/null and b/website/static/img/logo/vote-card.png differ diff --git a/website/tools/logo-assets.py b/website/tools/logo-assets.py index cc7c8ad..0797638 100644 --- a/website/tools/logo-assets.py +++ b/website/tools/logo-assets.py @@ -232,7 +232,37 @@ def b64png(im): return "data:image/png;base64," + base64.b64encode(buf.getvalue()).decode() +def vote_card(path): + """1200x630 share card for /logo/: M on cream, R on ink, side by side.""" + W, H = 1200, 630 + im = Image.new("RGBA", (W, H), "#f7f6f3") + ImageDraw.Draw(im).rectangle([W // 2, 0, W, H], fill=MARKS["r"]["ink"]) + for k, cx in (("m", W // 4), ("r", 3 * W // 4)): + m = mark_png(k, "flat", 330) + im.alpha_composite(m, (cx - m.width // 2, 110 - (m.height - 330) // 2)) + size = 46 + d = ImageDraw.Draw(im) + for text, cx, col in (("M", W // 4, "#6b6b6f"), ("R", 3 * W // 4, "#8a8a90")): + paths, tw = wordmark(text, size) + # letters via the same outlines: rasterise a tiny SVG for crisp text + svgtxt = (f'' + f'{paths}') + t = raster(svgtxt, round(tw), round(size * 1.3)) + im.alpha_composite(t, (cx - t.width // 2, 500)) + # url line, centred on the seam + paths, tw = wordmark("furtka.org/logo", 40) + svgtxt = (f'{paths}') + t = raster(svgtxt, round(tw), 52) + pad = 18 + box = Image.new("RGBA", (t.width + 2 * pad, t.height + 2 * pad), "#f7f6f3") + ImageDraw.Draw(box).rounded_rectangle([0, 0, box.width - 1, box.height - 1], 14, outline="#e4e3dc") + box.alpha_composite(t, (pad, pad)) + im.alpha_composite(box, (W // 2 - box.width // 2, 40)) + im.convert("RGB").save(path, optimize=True) + + def main(): + vote_card(os.path.join(SITE, "static", "img", "logo", "vote-card.png")) for k in MARKS: out = os.path.join(SITE, "static", "img", "logo", k) os.makedirs(out, exist_ok=True)