Skip to content
← PortfolioLive at welabs.devWordPress → Astro

weLabs Official · Case study Rebuilding welabs.dev in Astro without losing a URL or a lead form.

weLabs, a software agency in the weDevs group, moved its site from WordPress to static Astro on Cloudflare Pages. I turned someone else’s designs into the pages, wired the forms, and still deploy it.

●Mobile Lighthouse 100✓205 parity testsHome LCP 1.7 s
Months4so far
My commits93
Design rounds3
Mobile score100
My role
Developer, not the designer: pages, forms, deploys
The brief
Leave WordPress, keep every URL and lead form
Result
Four lead paths; a new design is a re-run
Stack
Astro, Cloudflare Pages, Contact Form 7, Playwright
01 — Timeline

Four months, three design rounds.

Pick a week to see what shipped.

Mine (93)Teammate and agent (23)
Week 2 · 52 mine · 9 teamThe busiest week: every page matched to the live WordPress site at every width, SEO parity, and the first forms as iframes.
02 — Platform

Static pages on Cloudflare, forms answered by WordPress.

  • Look identical to visitors
  • Every URL byte-identical
  • WordPress for the forms only
  • One GTM, consent denied by default
Visitor's browservanilla JS, TurnstileCloudflare Pages · welabs.devStatic Astro pagesbuilt from the design's HTMLPages Functions/api/availability · /api/bookGitHub · mainpush to deployWordPress, kept as a form backendContact Form 7REST feedback · validation · mailGoogle CalendarfreeBusy · event with Meet linkservice accountlead form POST + Turnstile token, straight to WordPress
Cloudflare Pages: A push to main builds the static pages, and two Pages Functions hold the Google Calendar credential that can’t live in the browser.
03 — Key decisions

Four pieces of work that shaped the rebuild.

Round one

Match a running site, breakpoint by breakpoint

The reference was the live WordPress site, not a design file, so every page was compared with it in a browser: computed styles, box sizes and animation timing, at every width. The hero’s lost animation hooks came back from the WordPress plugin’s own SVG.

Pixel parity with live
git log · round one
Day 1Home, About, Services, Why weLabs, Start a Project, BlogDay 2Hover states; every page at phone and tablet widthsDay 2Breakpoints moved to live’s 690px switch pointDay 2Hero and How We Work animations from the WP pluginDay 3Compact header, GSAP scroll animations, count-upsDay 4SEO tags and structured data matched to live✓ every page matched to live, at every width
Rounds two and three

A converter, not a hand copy

The redesigns came as Claude Design exports, one static HTML screen per page, so I wrote a converter that turns each screen into an Astro page under the shared header, footer, SEO and analytics. The second export got one generic converter that keeps hand edits in hooks, so the next export doesn’t wipe them.

Claude Design → Astro
By hand
  • Copy each exported screen into a page
  • One script per page
  • The next export wipes the hand edits
One converter for every screen ↓
The converter
  • Regenerates any page from its screen, under the shared header, footer, SEO and analytics
  • Hand edits kept in hooks and in v2.css
  • A parity suite checks every page against its screen
Lead forms

The design’s own form, posting to Contact Form 7

An iframe could never match the design, so Start a Project got the design’s own form, with Contact Form 7’s field names, posting to its REST endpoint. WordPress keeps the final say on validation and spam, and without JavaScript the form still posts to the WordPress page.

Contact Form 7 REST · Turnstile
Form pageTurnstileContact Form 7Team inboxWidget runsTokenPOST fields, file, tokenVerify with secretValidFields checked by the form's rulesEmail the briefmail_sent · validation_failed · spamThank-you modal, form reset,contact_form_submit to dataLayer
The spam token is checked by WordPress with its own secret, never by the page.
Round three

Real Google Calendar bookings, without a server

Book a Call used to open Google’s appointment overlay; now the design’s booking page runs on two Pages Functions, and Google emails the invite. The API signs in through a service account, with Web Crypto and plain fetch instead of Google’s SDK, and 17 handler tests cover it.

Pages Functions · Google Calendar
functions/api
GET /api/availability: one Google freeBusy query returns the open 30-minute startsPOST/api/book: checks the Turnstile token re-checks the slot is still free creates the event with a Meet linkauthservice-account JWT signed by Web Crypto✓ two test bookings landed with Meet links
04 — Speed

Mobile scores of 100, without changing the design.

PageSpeed Insights scored the homepage 71 on mobile. The page was fast; the time went to tag-manager JavaScript and a cookie banner that painted last.

100Homepage · mobile Lighthouse
Largest paint · home1.7 sCSS inlined, images sized, in the converters
Blocking time · home60 msGTM waits for the first input, or 10 s
Date formatters · bookingOne per timezoneShared by every slot in a timezone
Footer contrast6.2:1Plus darker badges and roles
Other pages · mobile, after the fixes
100Start a Project, from 72
100Our Services, from 72
100Book a Call, from 78
2.0 sAbout Us LCP, from 5.3 s
1.7 sIndustry page LCP, from 3.6 s

Lighthouse 13.5, mobile preset. The homepage, Start a Project and Our Services compare local preview builds. About Us, the industry page and Book a Call compare production with a local preview, so those pairs aren’t like for like.

05 — Screens

welabs.dev, on every screen.

Services, Headless WooCommerce and Dokan, AI Automation and more, as full pages.

06 — Who did what

Two developers, one repository.

93 / 116commits on main are mine, with 19 of 27 merged pull requests, 6 of 18 issues and 4 of 7 setup docs.
Mine (93)Teammate and agent (23)
I built

The pages matched to live, SEO parity, the converters, the forms and the booking API, the parity suite, and the deploys, then and now.

Others did

The design was never mine: it came from the old site and two Claude Design exports. A teammate did the migration plan and scaffold, the Dokan pages, the legal pages and round-the-clock booking.

Iframes first, kept as a rollback

For launch, the live Contact Form 7 forms ran as cropped iframes that load on scroll, with a height bridge so the crop never clips an error. My teammate fixed their caching and added tracking, and the iframe version still sits at a noindexed URL as a rollback.

The first production bug

The day the new form went live, every brief failed while WordPress answered spam: production had no Turnstile site key set, so it used a stale fallback in the code. The fallback now points at a key that verifies, and a form with no ID shows the contact email instead.

Where the page ranSite key it usedContact Form 7’s answer
localhostthe key from .envmail_sent
welabs.devthe stale fallback in codespam

Two redesigns, held to the pixel

Round two brought eleven new pages, checked in Chrome at 1800px until every section’s height matched its screen, and cut the photos from 12.6 MB to 637 KB. Round three redesigned every page, added a dozen more and two lead forms, and a Playwright suite holds each page within 0.5% of its screen: 205 tests passed.

Deploying it, and keeping it running

Deploys are pushes to main that Cloudflare Pages builds; the form IDs, Turnstile key and booking secrets live in its settings, so each pull request lists what to set there first. Since launch I’ve fixed what real use turned up, from a blinking booking overlay to layout bugs on real phones.

What a visitor never sees

Every URL keeps its trailing slash, title, meta and JSON-LD, with 301s for retired pages. Consent Mode v2 defaults to denied, booking events send no name or email to analytics, and fonts are self-hosted.

Built with Claude Code

Every one of my 93 commits carries a Claude co-author line. The two speed pull requests were written by an agent and opened and merged by me, so their five commits count as team commits.

AstroTailwind CSS v4Cloudflare PagesPages FunctionsContact Form 7Cloudflare TurnstileGoogle Calendar APIPlaywrightGSAPClaude Code

Non-merge commits on main, by author. Both redesigns were squash-merged, so 75 and 44 branch commits count as one each. Commit counts measure activity, not effort.

Lets work together

Need a successful project?

I’m available for freelance work.

Hire/Contact Me Now