Skip to content

fix(docs): add the $W favicon and serve it under /docs#243

Merged
jakemor merged 3 commits into
mainfrom
fix/docs-favicon
Jul 9, 2026
Merged

fix(docs): add the $W favicon and serve it under /docs#243
jakemor merged 3 commits into
mainfrom
fix/docs-favicon

Conversation

@claude

@claude claude Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Requested by Nick Godwin, Jake Mor · Slack thread

Before: the docs site (superwall.com/docs) rendered with no favicon at all.
After: it shows Superwall's orange "$W" docs mark.

The <link> tags reference /docs/favicon.* (via buildDocsPath), but the favicon assets only lived at public/ root, which the build emits to the site root. The docs Cloudflare Worker only serves assets under /docs/*, so every /docs/favicon.* URL 404'd (verified on prod: /docs/favicon.svg → 404, /favicon.svg → 200 from the main site).

How:

  • Added the "$W" mark at all referenced sizes: favicon.ico (16/32/48), favicon-96x96/-192/-512.png, apple-touch-icon.png (180), and favicon.svg (an SVG wrapper embedding the 512px PNG, since the source art is raster).
  • Mirror the favicon/manifest set into public/docs/ at build time in scripts/copy-docs-images.cjs (the same pattern already used for resources/ and images), so they emit to dist/client/docs/favicon.* and resolve at /docs/favicon.* from the docs Worker — its own icon, not superwall.com's root favicon.

Verified locally: vite build emits the new assets to dist/client/docs/favicon.*. End-to-end runtime check to follow from the Cloudflare preview deploy.

Note for the reviewer: the branch carries an earlier superseded commit (a root-path approach) below the final commit that reverts it — the cumulative diff vs main is the correct final state, so please squash-merge.


Generated by Claude Code

claude added 2 commits July 8, 2026 18:25
The favicon <link> tags and the web manifest referenced /docs/favicon.*
via buildDocsPath, but top-level public/ files are served from the site
root, not under the /docs base. Those /docs/favicon.* URLs 404'd, so the
docs site rendered with no favicon.

Point the icon/apple-touch-icon/shortcut-icon/manifest links and the
manifest's icon srcs at root-absolute paths (/favicon.svg, /favicon.ico,
/apple-touch-icon.png, /site.webmanifest, ...), which all resolve (200)
and match the main superwall.com favicon.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRF2wVQFGW44g9mSTJR9D
Replaces the earlier root-path approach: instead of pointing the icon
links at superwall.com's shared root favicon, serve the docs site's own
orange "$W" mark from the docs Cloudflare Worker under /docs/*.

Root cause: the <link> tags referenced /docs/favicon.* (via
buildDocsPath), but the favicon assets only lived at public/ root, which
the build emits to the site root. The docs worker only serves assets
under /docs/*, so /docs/favicon.* 404'd and the site had no favicon.

- Replace favicon assets with the "$W" docs mark: favicon.ico (16/32/48),
  favicon-96x96/-192/-512.png, apple-touch-icon.png (180), and
  favicon.svg (an SVG wrapper embedding the 512px PNG, since the source
  art is raster — keeps the existing svg <link> working).
- Mirror the favicon/manifest set into public/docs/ at build time in
  scripts/copy-docs-images.cjs (same pattern already used for resources/
  and images/), so they emit to dist/client/docs/favicon.* and resolve
  at /docs/favicon.*.
- Restore the __root.tsx links and site.webmanifest icon srcs to the
  /docs base (buildDocsPath).

Verified: `vite build` emits the new assets to dist/client/docs/favicon.*.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRF2wVQFGW44g9mSTJR9D
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
superwall-docs 8865302 Commit Preview URL

Branch Preview URL
Jul 08 2026, 07:06 PM

Regenerate favicon asset set from the new teal-on-dark-green $W
source PNG (96/192/512 PNGs, 180 apple-touch-icon, multi-size ICO
16/32/48, and the SVG wrapper embedding the 512 PNG).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRF2wVQFGW44g9mSTJR9D
@jakemor jakemor marked this pull request as ready for review July 9, 2026 16:29
@jakemor jakemor merged commit 8dafaec into main Jul 9, 2026
2 checks passed
@jakemor jakemor deleted the fix/docs-favicon branch July 9, 2026 16:29
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