From 6e950a01360dcb01a8eb6fc2850ed4137189f119 Mon Sep 17 00:00:00 2001 From: Matteo Perino Date: Wed, 14 Oct 2026 14:47:46 +0200 Subject: [PATCH] feat(web): the page wears GeoSuite's design and favicon The hosted Sitemap Builder still had its first look: a dark-blue theme, emoji used as icons and a location-pin favicon, while the hub at tools.trygeosuite.it and its AI Readiness Check had already moved to GeoSuite's design system. Visitors jumping between the free tools landed on what looked like a different site. The page now imports theme.js, copied from TryGeoSuite/geo-toolkit, and follows the hub's structure: the bar header with the free tools link and the language switch, a hero with the crawl form and a short "how it works" panel, the CLI command in a copyable box, results in themed panels (capped and error states carry an icon and text, not color alone) and the hub's closing call to action in place of the old promo box. Light and dark both follow the system setting. The worker serves GeoSuite's official favicon and touch icon as PNG on /favicon.png, /favicon.ico, /apple-touch-icon.png and the old /favicon.svg path, plus the three engine logos the call to action shows. The crawl, the API and the ?url= auto-run are unchanged. --- web/README.md | 3 +- web/apple-touch-icon.png | Bin 0 -> 5752 bytes web/favicon.png | Bin 0 -> 3210 bytes web/logos/chatgpt.svg | 10 ++ web/logos/gemini.svg | 1 + web/logos/perplexity.svg | 1 + web/page.js | 324 ++++++++++++++++++++++++--------------- web/theme.js | 120 +++++++++++++++ web/worker.js | 28 +++- web/wrangler.toml | 8 +- 10 files changed, 364 insertions(+), 131 deletions(-) create mode 100644 web/apple-touch-icon.png create mode 100644 web/favicon.png create mode 100644 web/logos/chatgpt.svg create mode 100644 web/logos/gemini.svg create mode 100644 web/logos/perplexity.svg create mode 100644 web/theme.js diff --git a/web/README.md b/web/README.md index 6395b2c..7ad1548 100644 --- a/web/README.md +++ b/web/README.md @@ -5,7 +5,8 @@ A [Cloudflare Worker](https://developers.cloudflare.com/workers/) that puts a sitemaps.org-compliant `sitemap.xml` to copy or download. - `GET /` — the page (`page.js`), bilingual **en/it** (auto-detected from `Accept-Language`; `/en` · `/it` force a locale) -- `GET /og.png` · `GET /favicon.svg` — Open Graph share image (1200×630) + favicon +- `GET /og.png` · `GET /favicon.png` (also `/favicon.ico`, `/favicon.svg`, `/apple-touch-icon.png`) — Open Graph share image (1200×630) + GeoSuite's favicon +- `GET /logos/{chatgpt,gemini,perplexity}.svg` — engine logos for the call to action - `GET /api/crawl?url=https://example.com` — `{ site, count, capped, xml }` > ⚠️ **Capped edge version.** The crawl is a small BFS (≤40 pages, depth ≤2) diff --git a/web/apple-touch-icon.png b/web/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..530c1846513cc776d4c511df42ee6e9c3edaf811 GIT binary patch literal 5752 zcmeHLcTiK?yA2&e5u{2l(g_JYbm?+MswfBu0TNmWAqfy^ktR|EQF<>TDj+BbCzdP@*H*e<6yfd@2zq8I>>s#O1XYZ3F!P?S{703?+006A! zr;TkXef?2mq^5j6s!4-WIx4KKnIYgozu+R}WE$>ZjyQW3AV-NA0rXV-0J@_gly;s< z;E(tcl?;I92TswUQUV;Q8B-d9O8ZC5Oo{Ku`v7Qvi~#@|DE-mlMrlV{KYAk=Di|gz zV+%)l!ZC1+tf*&zhpw@~X+vXo4^3-BFVP?@9HVP*VCHCV=k256?j`DufuTHg4UZ6n zkM#vZRe%8!j>S?yOaMidrkLtCSCkyZ)PH2JFQ)l3ri=qv0X0ujIwtgKM=Suq_Ux!p zWyrG$P&C?o&N<*5&RS@B1o$h$JOkX}igEac>+Btpx^$ zgoG%Ds3-U3XUPj?ycn}IJ@l)h?9b-7w1LK3n`2?Uuk91+~ z0YNxjaq*)>e;hx3;(QQ)WM_mb&f1(*}|~_$e^QI>`^{AJ!PFA&i)DiS=vvQ z7hVtjw%L%}lK9?9I=ah=N2Z^&L$a(&z6oKheLd>wy2ohzOzf18n? zZvXPk|ETaMN?B2QKnnBs)u{)>;VNbU01mjhvB5b!)pCIol6#Kl%7md$iOI!r%%TbC zToQc?ohJXa{poMUO8jaz$As6s-IJ|M*Si*CrjwXVXXZ%HcHKUZo-w3Q&Ejcv`DR$H zPuf7s!Ql)?J@dr7wAVBxo-E^)Ehp+_+@rs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)Np>0&mUy=l{?nAq5z zhvz0_MyZL zKwrK8^iE>slR0;HcZ$wkwqwi`q`af8@kE}04j11#vP}ti|L@Pw+ef=5KccbwY*rL6t1*^pj{e= zZhf#@>0)WA>+>=gnsn8E7*f-TP9W_cNhnws0gOMIKi+Ln{#wA{$ji$Iy?UIPmX^4` z7aSEn_g@a&ix&@vDuP@35)ePx~r- z2CfIM);1_94&yRMk2T0f<8;zCYR^;GWaU{TF5e6NqxWtmAy}Wn@br*DN1Z^}!z>Ce1$WSkVpDZaA?8x_t{ISl zg@qZNp`vbaxi_`z(W6JnKiW~NG5$6E1v#lD{)(%@Po8_TuyC2%Tg6vz8+IG-uL*L? z!H_&}(a&^jFVTP^*ol5ozbbC6%*i=ge9G&(WL2(FgJgDXu`5|qMW!Gx4<>Kxn|mi= z{jN4Sx#8X<#;c0~@*OCwZgGN;6fW>S3adj**GeXb#{a1DSHh`V!@9>hFZ7{G36N_3 zz1J5M+KZ23Z0p!-I-3F&a(Zt1cGM2)6NyB#_+xG%DF zByZ;?i(E@%wiy@e&CSk(htJ(TbR-u-pY81I^lAH7eN~}RY+{{i;vGj#TAGcQ;ZGSseVCKIjr`c-vK5~gUE#g0Oi`@_a literal 0 HcmV?d00001 diff --git a/web/logos/chatgpt.svg b/web/logos/chatgpt.svg new file mode 100644 index 0000000..2312a77 --- /dev/null +++ b/web/logos/chatgpt.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/web/logos/gemini.svg b/web/logos/gemini.svg new file mode 100644 index 0000000..ecc24b6 --- /dev/null +++ b/web/logos/gemini.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/logos/perplexity.svg b/web/logos/perplexity.svg new file mode 100644 index 0000000..5f5a5ab --- /dev/null +++ b/web/logos/perplexity.svg @@ -0,0 +1 @@ +Perplexity \ No newline at end of file diff --git a/web/page.js b/web/page.js index f8269ee..fd6ecad 100644 --- a/web/page.js +++ b/web/page.js @@ -3,62 +3,115 @@ // dictionary below. The interactive crawl form talks to /api/crawl and renders the // result; its visitor-visible strings are injected as I18N and read at runtime. // +// It wears GeoSuite's design (theme.js, shared with the hub at tools.trygeosuite.it): +// same bar, hero, panels and closing call to action, so the free tools read as +// one site. Icons are inline line SVGs, never emoji, and a state is always +// spelled out in text next to its color. +// // Product names and "sitemap.xml" stay as-is; only prose/labels/buttons translate. +import { FONTS, BASE_CSS, ENGINES } from './theme.js'; + const BASE = 'https://sitemap-builder.geosuite.workers.dev'; +const HUB = 'https://tools.trygeosuite.it'; +const REPO = 'https://github.com/TryGeoSuite/sitemap-builder'; +const NPM = 'https://www.npmjs.com/package/@geosuite/sitemap-builder'; +const ANALYSIS = 'https://trygeosuite.it/analisi-gratuita?utm_source=geosuite-open&utm_medium=tool&utm_campaign=sitemap-builder'; +const CMD = 'npx @geosuite/sitemap-builder <url>'; + +// Filled circle + white mark, colored by the surrounding state class. Always +// next to a text label, never the only signal. +const ICONS = { + ok: '', + warn: '', + crit: '', +}; +const STAR = ''; const S = { en: { - title: 'Sitemap Builder — generate a sitemap.xml by crawling your site', + title: 'Sitemap Builder: generate a sitemap.xml by crawling your site', desc: 'Paste a URL and get a sitemaps.org-compliant sitemap.xml by crawling your site. Free, capped quick version; use the CLI for a full crawl.', - h1: 'Sitemap Builder', - lead: `Paste a URL — we crawl your site and build a sitemap.xml you can copy or download.`, - promo: `Built by GeoSuite — the AI-visibility platform that measures & improves how ChatGPT, Gemini, Claude & Perplexity describe your brand.`, - promoCta: 'Explore GeoSuite →', - star: '★ Star on GitHub', - placeholder: 'https://example.com', - build: 'Build', + nav: 'Site', + tools: 'Free tools', + eyebrow: 'Sitemap Builder, a free GeoSuite tool', + h1: 'Turn your site into a sitemap.xml', + lead: `Paste a URL: we crawl your site and build a sitemap.xml you can copy or download.`, + label: 'Your website', + placeholder: 'yoursite.com', + build: 'Build the sitemap', + facts: ['Free', 'No sign-up', 'Open source (MIT)', 'sitemaps.org compliant'], + howLabel: 'How it works', + how: [ + 'We start from the page you paste and follow the links that stay on your site.', + 'Up to ~40 pages, two clicks deep, so the answer comes back in seconds.', + 'You get a valid sitemap.xml to copy or download, ready for your site root.', + ], + cliLabel: 'From the terminal', hintPre: 'Quick crawl, capped at ~40 pages (depth 2) to stay fast. For a full crawl of a large site, use the CLI:', - footerOss: 'Open source (MIT):', - footerBuilt: `Built by Matteo Perino · a GeoSuite open-source tool.`, + copyCmd: 'Copy', + copiedCmd: 'Copied', + copyLabel: 'Copy the command', + star: 'Star on GitHub', + ctaTitle: 'Being found is step one. Being recommended is the goal.', + ctaText: 'A sitemap.xml helps crawlers, AI ones included, find every page you want read. GeoSuite checks what happens next: it asks ChatGPT, Gemini and Perplexity the questions your customers really ask, and tells you where you appear, who wins instead and what to fix first. The report arrives by email.', + ctaButton: 'Get the free analysis', + footer: `Open source (MIT) by Matteo Perino, maintained under GeoSuite, the Italian platform for AI visibility. Code on GitHub, package on npm.`, // Strings read at runtime by the interactive crawl script. js: { crawling: 'Crawling', crawlingTail: '… (up to ~40 pages)', - networkError: 'Network error — try again.', - cappedPre: '⚠️ Capped at', + networkError: 'Network error, try again.', + cappedPre: 'Capped at', cappedPost: 'pages (the edge version stays fast). Run the CLI for a full crawl.', sitemapFor: 'sitemap.xml for', + page: 'page', pages: 'pages', copy: 'Copy', - copied: 'Copied ✓', + copied: 'Copied', download: 'Download', }, }, it: { - title: 'Sitemap Builder — genera un sitemap.xml esplorando il tuo sito', + title: 'Sitemap Builder: genera un sitemap.xml esplorando il tuo sito', desc: 'Incolla un URL e ottieni un sitemap.xml conforme a sitemaps.org esplorando il tuo sito. Versione rapida e limitata gratuita; usa la CLI per un crawl completo.', - h1: 'Sitemap Builder', - lead: `Incolla un URL — esploriamo il tuo sito e costruiamo un sitemap.xml che puoi copiare o scaricare.`, - promo: `Creato da GeoSuite — la piattaforma di visibilità AI che misura e migliora come ChatGPT, Gemini, Claude e Perplexity descrivono il tuo brand.`, - promoCta: 'Scopri GeoSuite →', - star: '★ Stella su GitHub', - placeholder: 'https://esempio.com', - build: 'Costruisci', + nav: 'Sito', + tools: 'Strumenti gratuiti', + eyebrow: 'Sitemap Builder, uno strumento gratuito di GeoSuite', + h1: 'Trasforma il tuo sito in un sitemap.xml', + lead: `Incolla un URL: esploriamo il tuo sito e costruiamo un sitemap.xml che puoi copiare o scaricare.`, + label: 'Il tuo sito', + placeholder: 'tuosito.it', + build: 'Costruisci la sitemap', + facts: ['Gratis', 'Senza registrazione', 'Open source (MIT)', 'Conforme a sitemaps.org'], + howLabel: 'Come funziona', + how: [ + 'Partiamo dalla pagina che incolli e seguiamo i link che restano sul tuo sito.', + 'Fino a ~40 pagine, a due clic di profondità, così la risposta arriva in pochi secondi.', + 'Ottieni un sitemap.xml valido da copiare o scaricare, pronto per la radice del sito.', + ], + cliLabel: 'Dal terminale', hintPre: 'Crawl rapido, limitato a ~40 pagine (profondità 2) per restare veloce. Per un crawl completo di un sito grande, usa la CLI:', - footerOss: 'Open source (MIT):', - footerBuilt: `Creato da Matteo Perino · uno strumento open-source di GeoSuite.`, + copyCmd: 'Copia', + copiedCmd: 'Copiato', + copyLabel: 'Copia il comando', + star: 'Stella su GitHub', + ctaTitle: 'Farsi trovare è il primo passo. Farsi consigliare è l’obiettivo.', + ctaText: 'Un sitemap.xml aiuta i crawler, anche quelli delle AI, a trovare tutte le pagine che vuoi far leggere. GeoSuite controlla cosa succede dopo: fa a ChatGPT, Gemini e Perplexity le domande che i tuoi clienti fanno davvero, e ti dice dove compari, chi vince al posto tuo e cosa correggere per primo. Il report arriva via mail.', + ctaButton: 'Richiedi l’analisi gratuita', + footer: `Open source (MIT) di Matteo Perino, mantenuto da GeoSuite, la piattaforma italiana per la visibilità sulle AI. Codice su GitHub, pacchetto su npm.`, // Stringhe lette a runtime dallo script interattivo del crawl. js: { crawling: 'Esplorazione di', crawlingTail: '… (fino a ~40 pagine)', - networkError: 'Errore di rete — riprova.', - cappedPre: '⚠️ Limitato a', + networkError: 'Errore di rete, riprova.', + cappedPre: 'Limitato a', cappedPost: 'pagine (la versione edge resta veloce). Lancia la CLI per un crawl completo.', sitemapFor: 'sitemap.xml per', + page: 'pagina', pages: 'pagine', copy: 'Copia', - copied: 'Copiato ✓', + copied: 'Copiato', download: 'Scarica', }, }, @@ -79,7 +132,8 @@ export function renderPage(lang) { - + + @@ -93,101 +147,106 @@ export function renderPage(lang) { +${FONTS}
- -
-

🗺️ ${t.h1}

-

${t.lead}

+
+ GeoSuite +
-
-
${t.promo}
-
- ${t.promoCta} - ${t.star} +
+
+
+

${t.eyebrow}

+

${t.h1}

+

${t.lead}

+
+ + + +
+
    ${t.facts.map((f) => `
  • ${ICONS.ok}${f}
  • `).join('')}
+
+ +
-
- -
- - -
-

${t.hintPre} npx @geosuite/sitemap-builder <url>

- -
- -
- ${t.footerOss} GitHub - · npm - · npx @geosuite/sitemap-builder <url>
- ${t.footerBuilt} -
+ +
+ +
+
+

${t.ctaTitle}

+

${t.ctaText}

+ ${ENGINES} +
+ ${t.ctaButton} +
+ + +
${t.footer}
- + + `; } diff --git a/web/theme.js b/web/theme.js new file mode 100644 index 0000000..2ddeba0 --- /dev/null +++ b/web/theme.js @@ -0,0 +1,120 @@ +// Visual layer copied from TryGeoSuite/geo-toolkit/theme.js (the hub at +// tools.trygeosuite.it and its AI Readiness Check), so this tool reads as part +// of the same site. Keep it in step with that file: change it there first, then +// copy it here unchanged except for this comment. +// +// It follows GeoSuite's design system (geo/design-system/geosuite/MASTER.md): +// Inter, flat surfaces with one-pixel lines, magenta only for the primary action +// and the visitor's own row, semantic colors always paired with text or an icon, +// light and dark both first-class. The brand is text, like GeoSuite's own +// header: the official wordmark is white on transparent and must not be +// recolored for the light theme. + +export const FONTS = ` + +`; + +// Tokens, page chrome (bar, hero, footer) and the components both pages use: +// the URL form, panels, the ranked list, the GeoSuite call to action. +export const BASE_CSS = ` + :root { + --bg:#f4f5f7; --surface:#fff; --surface-2:#f8f9fb; --sunk:#eef0f3; + --ink:#111318; --ink-2:#424854; --ink-3:#596474; + --line:#e5e7eb; --line-2:#d8dce2; + --accent:#e0327d; --accent-deep:#b81862; --accent-soft:#fdeaf3; --accent-ink:#a3105a; --on-accent:#fff; + --ok:#127348; --ok-soft:#e7f6ec; --warn:#875000; --warn-soft:#fbf1de; --crit:#bd2838; --crit-soft:#fdeaeb; + --shadow:0 1px 2px rgba(17,19,24,.06); + } + @media (prefers-color-scheme: dark) { + :root { + --bg:#111318; --surface:#181b21; --surface-2:#20242c; --sunk:#0d0f13; + --ink:#f5f7fa; --ink-2:#c5cad3; --ink-3:#979eaa; + --line:#282d36; --line-2:#353c48; + --accent:#f2529a; --accent-deep:#b81862; --accent-soft:#2a1420; --accent-ink:#f7a6cb; + --ok:#39c877; --ok-soft:#12241a; --warn:#e0a53c; --warn-soft:#27200f; --crit:#f0666d; --crit-soft:#2a1416; + --shadow:0 1px 2px rgba(0,0,0,.28); + } + } + * { box-sizing:border-box; } + html { -webkit-text-size-adjust:100%; } + body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing:antialiased; } + a { color:var(--accent-ink); } + :focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; } + .wrap { max-width:880px; margin:0 auto; padding:0 16px 64px; } + + .bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 0; } + .brand { color:var(--ink); text-decoration:none; font-size:19px; font-weight:700; letter-spacing:-.035em; } + .bar nav { display:flex; align-items:center; gap:4px; font-size:.875rem; } + .bar nav a { color:var(--ink-3); text-decoration:none; padding:6px 10px; border-radius:8px; min-height:32px; display:inline-flex; align-items:center; } + .bar nav a:hover { color:var(--ink); background:var(--sunk); } + .bar nav a[aria-current="page"] { color:var(--ink); background:var(--surface); box-shadow:inset 0 0 0 1px var(--line); } + + .hero { display:grid; grid-template-columns:1fr; gap:32px; padding:40px 0 8px; align-items:start; } + @media (min-width:900px) { .wrap { max-width:1080px; } .hero { grid-template-columns:1.15fr 1fr; gap:48px; } } + .eyebrow { display:inline-block; font-size:.8125rem; font-weight:600; color:var(--accent-ink); background:var(--accent-soft); padding:4px 10px; border-radius:999px; margin:0 0 16px; } + h1 { font-size:clamp(2rem, 4.6vw, 3rem); line-height:1.08; letter-spacing:-.03em; margin:0 0 14px; text-wrap:balance; } + .lead { color:var(--ink-2); font-size:1.125rem; margin:0 0 24px; max-width:48ch; } + .urlform { display:flex; gap:8px; } + .urlform label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); } + input { flex:1; min-width:0; height:52px; background:var(--surface); border:1px solid var(--line-2); color:var(--ink); border-radius:8px; padding:0 16px; font:inherit; font-size:1.0625rem; } + input::placeholder { color:var(--ink-3); } + button { font:inherit; cursor:pointer; } + .primary { height:52px; padding:0 22px; border:0; border-radius:8px; background:var(--accent-deep); color:var(--on-accent); font-weight:600; white-space:nowrap; min-width:150px; } + .primary:hover { background:#9a1352; } + .primary[disabled] { opacity:.65; cursor:progress; } + .facts { display:flex; flex-wrap:wrap; gap:6px 16px; list-style:none; margin:14px 0 0; padding:0; color:var(--ink-3); font-size:.875rem; } + .facts li { display:flex; align-items:center; gap:6px; } + .facts strong { color:var(--ink-2); font-weight:600; font-variant-numeric:tabular-nums; } + .facts svg { width:14px; height:14px; } .facts svg circle { fill:var(--ok); } .facts svg path { stroke:#fff; } + .err { color:var(--crit); margin:12px 0 0; min-height:1.5em; font-size:.9375rem; } + + .panel, .example { background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); } + .label { font-size:.75rem; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-3); margin:0; } + .q { font-size:1.0625rem; font-weight:500; color:var(--ink); margin:12px 0 16px; padding-left:14px; border-left:3px solid var(--line-2); } + + .example { padding:20px; margin:0; } + .example figcaption { display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; } + .ex-meta { color:var(--ink-3); font-size:.8125rem; } + .ex-verdict { display:flex; gap:8px; align-items:center; font-weight:600; margin:0 0 12px; } + .ex-verdict svg { width:18px; height:18px; flex:none; } .ex-verdict svg circle { fill:var(--ok); } .ex-verdict svg path { stroke:#fff; } + .example[hidden], section[hidden], div[hidden] { display:none; } + + ol.recs { list-style:none; margin:0; padding:0; border:1px solid var(--line); border-radius:8px; overflow:hidden; } + ol.recs li { display:grid; grid-template-columns:28px 1fr auto; align-items:start; gap:12px; padding:12px 14px; border-top:1px solid var(--line); } + ol.recs li:first-child { border-top:0; } + ol.recs .n { font-variant-numeric:tabular-nums; font-weight:600; color:var(--ink-3); text-align:center; line-height:1.5; } + ol.recs .name { font-weight:600; min-width:0; overflow-wrap:anywhere; } + ol.recs li.you { background:var(--accent-soft); } + ol.recs li.you .n, ol.recs li.you .name { color:var(--accent-ink); } + ol.recs.compact li { grid-template-columns:28px 1fr; padding:10px 12px; } + .tag { display:inline-block; margin-left:6px; padding:1px 8px; border-radius:999px; background:var(--accent-deep); color:var(--on-accent); font-size:.75rem; font-weight:600; vertical-align:2px; } + + .cta { margin-top:16px; padding:28px; display:grid; grid-template-columns:1fr auto; gap:24px; align-items:center; } + .cta h2 { font-size:1.375rem; line-height:1.25; margin:0 0 8px; letter-spacing:-.015em; } + .cta p { color:var(--ink-2); margin:0; max-width:58ch; } + .engines { display:flex; align-items:center; gap:14px; margin-top:16px; color:var(--ink-3); font-size:.8125rem; flex-wrap:wrap; } + .engines span { display:inline-flex; align-items:center; gap:6px; color:var(--ink-2); font-weight:500; } + .engines img { width:20px; height:20px; display:block; } + .cta a.primary { display:inline-flex; align-items:center; text-decoration:none; } + .ghost { background:none; border:1px solid var(--line-2); color:var(--ink-2); border-radius:8px; padding:8px 12px; font-size:.875rem; min-height:36px; } + .ghost:hover { color:var(--ink); border-color:var(--ink-3); } + + footer { margin-top:48px; padding-top:20px; border-top:1px solid var(--line); color:var(--ink-3); font-size:.8125rem; } + footer a { color:var(--ink-2); } + + @media (max-width:640px) { + .hero { padding-top:20px; } + .urlform { flex-direction:column; } + .urlform input { flex:none; width:100%; } + .primary { width:100%; } + .cta { grid-template-columns:1fr; padding:20px; } + .cta a.primary { justify-content:center; } + } +`; + +// The three engines GeoSuite's analysis asks, served by the worker at /logos/. +export const ENGINES = ``; diff --git a/web/worker.js b/web/worker.js index cf773de..f0be9d2 100644 --- a/web/worker.js +++ b/web/worker.js @@ -11,14 +11,26 @@ // GET / → the page, locale from Accept-Language (it → Italian) // GET /en /it → the page in that locale // GET /api/crawl?url=... → { site, count, capped, xml, error } -// GET /og.png /favicon.svg → static assets +// GET /og.png → Open Graph share image +// GET /favicon.png /favicon.ico /favicon.svg /apple-touch-icon.png +// → GeoSuite's favicon (PNG; /favicon.svg is the old +// path, kept so cached links still get an icon) +// GET /logos/{chatgpt,gemini,perplexity}.svg → engine logos for the CTA import { renderSitemapXml } from '../src/sitemap.js'; import { renderPage } from './page.js'; import OG_PNG from './og.png'; // bundled as ArrayBuffer via the wrangler "Data" rule +// GeoSuite's official favicon (96px) and touch icon (180px): never redraw or recolor. +import FAVICON_PNG from './favicon.png'; +import TOUCH_ICON_PNG from './apple-touch-icon.png'; +// The AI engines' logos in the closing call to action, copied from +// TryGeoSuite/geo-toolkit/logos (bundled as text via the wrangler "Text" rule). +import LOGO_CHATGPT from './logos/chatgpt.svg'; +import LOGO_GEMINI from './logos/gemini.svg'; +import LOGO_PERPLEXITY from './logos/perplexity.svg'; -// A geo "location pin" mark in the GeoSuite accent — inline SVG, no binary. -const FAVICON = ``; +const ENGINE_LOGOS = { chatgpt: LOGO_CHATGPT, gemini: LOGO_GEMINI, perplexity: LOGO_PERPLEXITY }; +const ICON_PATHS = { '/favicon.png': FAVICON_PNG, '/favicon.ico': FAVICON_PNG, '/favicon.svg': FAVICON_PNG, '/apple-touch-icon.png': TOUCH_ICON_PNG }; // '/it' → 'it', '/en' → 'en', '/' → first Accept-Language tag (it → 'it', else 'en'). function pickLang(request, path) { @@ -130,8 +142,14 @@ export default { headers: { 'content-type': 'image/png', 'cache-control': 'public, max-age=86400' }, }); } - if (path === '/favicon.svg') { - return new Response(FAVICON, { + if (Object.hasOwn(ICON_PATHS, path)) { + return new Response(ICON_PATHS[path], { + headers: { 'content-type': 'image/png', 'cache-control': 'public, max-age=86400' }, + }); + } + const logo = path.match(/^\/logos\/(chatgpt|gemini|perplexity)\.svg$/); + if (logo) { + return new Response(ENGINE_LOGOS[logo[1]], { headers: { 'content-type': 'image/svg+xml; charset=utf-8', 'cache-control': 'public, max-age=86400' }, }); } diff --git a/web/wrangler.toml b/web/wrangler.toml index 3bbae63..7de17b0 100644 --- a/web/wrangler.toml +++ b/web/wrangler.toml @@ -2,10 +2,12 @@ name = "sitemap-builder" main = "worker.js" compatibility_date = "2025-01-01" -# Bundle the OG share image (1200×630 PNG) as an ArrayBuffer the Worker serves -# at /og.png — no external host, CSP-safe. +# Bundle the PNGs (OG share image, favicon, touch icon) as ArrayBuffers the +# Worker serves itself: no external host, CSP-safe. rules = [ - { type = "Data", globs = ["**/*.png"], fallthrough = false } + { type = "Data", globs = ["**/*.png"], fallthrough = false }, + # The AI engines' logos in the call to action, copied from geo-toolkit/logos. + { type = "Text", globs = ["**/*.svg"], fallthrough = false } ] # No nodejs_compat / npm install needed: the Worker reuses only the pure