Skip to content

Serve every resume design as a selectable theme - #54

Merged
Aswinmcw merged 1 commit into
mainfrom
feat/theme-picker
Sep 16, 2026
Merged

Aswinmcw merged 1 commit into
mainfrom
feat/theme-picker

Conversation

@Aswinmcw

Copy link
Copy Markdown
Member

Why

Twenty alternative layouts sit in open PRs (#16–#25, #36–#47), each replacing resume.html, and half of them have drifted into conflict. This makes every design a first-class theme on the live site so they can all be previewed from one page, and each design PR can then land as a one-file addition instead of a rewrite.

What

  • Themes are resume.html (default, id navy) plus every themes/NN-<id>.html. A theme is a standalone A4 page that declares <meta name="theme-name"> and <meta name="theme-description">. scripts/embed.mjs bundles them all into themes.embedded.json with one copy of the fonts and the 1.2 MB photo, and fails the build on a theme missing its metadata or lacking exactly one literal <head>, <body>, <style>.
  • Worker: default theme stays at / and /Aswin_Resume.pdf (existing links unchanged). Other themes at /themes/<id> and /themes/<id>/Aswin_Resume.pdf; /themes lists them all. Fonts and photo are spliced in at request time; PDFs cached in KV per theme-content hash, so editing one theme re-renders only that one.
  • Top bar: theme <select>, ‹ › arrows, ← → keys, PDF button for the current theme. Non-default themes zoom to fit narrow screens (bar and chat bubble counter-scaled); the default keeps its phone reflow.
  • Housekeeping: photo.jpg is actually a PNG, so its data URI now says image/png. build.sh takes an optional theme file. README documents adding a theme.

This PR adds no theme files. Each design PR will be updated to add its own themes/NN-<id>.html on top of this, so they merge independently and without conflicts.

Test plan

  • npm run embed with 0 and 20 extra themes; tsc --noEmit clean.
  • wrangler dev: /, /index.html, /themes, /themes/<id>, trailing slashes, 404 for unknown ids and stray files; picker shows all themes with the current one selected; PDF link points at the current theme; ETag → 304.
  • Headless Chrome screenshots at 1280/600/500 px for default, Bauhaus, Glass, Warm Minimal, and the gallery.
  • Spliced HTML for all 21 themes printed with local Chrome; all render. (Several of the existing designs run to two A4 pages — that is how they were authored, not a change here.)
  • PDF route end-to-end on the Cloudflare preview URL (local Browser Run never finished downloading Chromium).

🤖 Generated with Claude Code

Replace the one-design Worker with a theme system so alternative layouts
can be previewed on the live site instead of living in open PRs.

- scripts/embed.mjs bundles resume.html plus every themes/*.html into
  themes.embedded.json, with one copy of the fonts and photo. Each theme
  declares <meta name="theme-name"> / <meta name="theme-description">;
  the build refuses a theme without them or without exactly one literal
  <head>, <body> and <style>.
- The Worker splices fonts and photo into a theme at request time and
  serves the default at / and /Aswin_Resume.pdf as before, every other
  theme at /themes/<id> and /themes/<id>/Aswin_Resume.pdf, and an index
  at /themes. PDFs are cached in KV per theme-content hash.
- The top bar gains a theme picker with prev/next arrows (and left/right
  keys). On narrow screens non-default themes scale to fit the viewport
  while the bar and chat bubble stay full size; the default theme keeps
  its hand-tuned phone reflow.
- The photo file is a PNG despite its .jpg name; the data URI now says so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Aswinmcw
Aswinmcw requested review from a team and Aswin-coder as code owners September 16, 2026 08:16
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

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
resume 0ac616a Commit Preview URL

Branch Preview URL
Sep 16 2026, 08:16 AM

@Aswincloud-Bot Aswincloud-Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: @Aswinmcw is a member of @Aswincloud/admins.

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