Skip to content

🐛 Upgrade staticalize to 0.3.0 so the sitemap is valid - #73

Merged
taras merged 1 commit into
v1from
fix/staticalize-sitemap-xml
Sep 28, 2026
Merged

taras merged 1 commit into
v1from
fix/staticalize-sitemap-xml

Conversation

@taras

@taras taras commented Sep 28, 2026

Copy link
Copy Markdown
Member

Motivation

Every sitemap this site has deployed is invalid. Staticalize wraps each <loc>
in <urls> rather than <url>, which is not the
sitemaps.org schema, so crawlers are
handed a document whose entries they have no reason to understand.

It went unnoticed because staticalize's own reader accepts either spelling
(xml.urlset.url ?? xml.urlset.urls), so a site staticalized twice round-trips
its own invalid output. thefrontside/staticalize#14 has the details;
thefrontside/staticalize#15 fixes the writer, and 0.3.0 is the first release
that carries it
.

One of four sites in the org on an affected version — see the table at the
bottom.

Approach

One line: the staticalize task in deno.json moves from 0.2.6 to 0.3.0. Both
deploy jobs run deno task staticalize, so the workflow needs no change, and
nothing in deno.lock references the package — the task names the full jsr:
url, so it is not an import map entry.

0.3.0 requires --retries, where 0.2.6 applied a documented default of 3.
The task did not pass it, so it would have started failing outright:

retries: Invalid input: expected number, received undefined

It now passes --retries=3, which is the value it was already getting. That
requirement is itself a bug (thefrontside/staticalize#19), already fixed by
thefrontside/staticalize#20 but not yet released — once it ships, the flag can
come back out.

Two other fixes ride along in 0.3.0:

  • the path component of --base is honoured — this site's base is
    https://graphgen-data.netlify.app, which has no path, so nothing changes
  • self-referencing urls are rewritten outside HTML as well, not only inside it

That second one is the only place this could have interacted with
fix-static-css.ts, so I read it: it walks .html files and replaces Twind CSS
and state, and does not touch urls. The two do not overlap.

Tests

Served a two-page site with a valid sitemap and staticalized it with both
versions:

0.2.6, what this site runs today

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <urls>
    <loc>https://example.com/</loc>
  </urls>
</urlset>

0.3.0, this PR

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
  </url>
</urlset>

I also checked that --site still works, since 0.3.0's --help now presents the
site as a positional argument. It does; no caller needs changing.

Other sites that need the same bump

repo local task CI binary status
thefrontside/frontside.com 0.2.6 → 0.3.0 v0.2.7 → v0.3.0 thefrontside/frontside.com#508
thefrontside/interactors 0.2.2 → 0.3.0 v0.2.6 → v0.3.0 thefrontside/interactors#332
thefrontside/graphgen 0.2.6 → 0.3.0 runs the task this PR
thefrontside/effection 0.2.2 → 0.3.0 v0.2.6 → v0.3.0 thefrontside/effection#1248

Every sitemap this site has deployed wraps each `<loc>` in `<urls>` rather
than `<url>`, which is not the sitemaps.org schema. Crawlers are handed a
document whose entries they have no reason to understand.

It went unnoticed because staticalize's own reader accepts either spelling,
so a site staticalized twice round-trips its own invalid output.
thefrontside/staticalize#15 fixes the writer; 0.3.0 is the first release
with it.

0.3.0 requires `--retries`, where 0.2.6 applied a default of 3. The task did
not pass it, so it passes 3 now and keeps the behaviour it had.
@taras
taras merged commit 8fb9f1d into v1 Sep 28, 2026
4 of 7 checks passed

This branch had an error being deployed

1 failed deployment
Preview — bb2ef046 Deployed Sep 28, 2026 by taras via deploy-preview #10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants