Skip to content

feat(web): port homepage to Astro static page (PR 3b)#14

Merged
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/port-homepage-to-astro
May 19, 2026
Merged

feat(web): port homepage to Astro static page (PR 3b)#14
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/port-homepage-to-astro

Conversation

@caio-pizzol

Copy link
Copy Markdown
Contributor

Moves the legacy static homepage into the Astro pipeline. PR 3b from the migration sequence.

What changes: `apps/web/public/index.html` -> `apps/web/src/pages/index.astro`. Git detects the rename (98% similarity). The actual diff is 17 insertions / 3 deletions:

  • Astro frontmatter comment block (no logic, just explaining why this page bypasses Layout.astro)
  • 3 inline tag directives: `<script is:inline>` x2 + `<style is:global is:inline>` x1, so Astro preserves the legacy inline JS/CSS verbatim instead of trying to bundle/transpile them

What stays the same: literally everything else. Markup, CSS, JS, SEO meta, OG/Twitter brand tagline, Dataset JSON-LD (with variableMeasured/inLanguage/measurementTechnique), favicon paths, About section's 19 static type/topic links, footer, preview modal, the explorer's runtime fetches to api.docxcorp.us.

Why no Layout.astro: the homepage has its own brand chrome (different header/footer markup) and a richer Dataset JSON-LD than the shared one. Forcing it through Layout would require extending Layout with ogTitle/ogDescription/twitterDescription/structuredData overrides for one consumer. Standalone is simpler. The other 25 Astro pages still use Layout.

Verified locally:

  • `bun run --cwd apps/web build` -> 26 pages built in 18s (was 25)
  • `bun run --cwd apps/web typecheck` -> 0 errors, 0 warnings
  • `dist/index.html` (43.7 KB, was ~45 KB after Astro's minification): preserves the SEO title, brand-tagline og:title, full JSON-LD, all 19 type/topic links, explorer JS globals

Smoke test after merge (auto-deploys via push trigger):
```bash
curl -sI https://docxcorp.us/ | grep -iE "HTTP/|content-type|cache-control|cf-cache-status"
curl -s https://docxcorp.us/ | grep -c "renderTypesGrid" # should be 1+
curl -s https://docxcorp.us/ | grep -oE '

[^<]+

' # should be the SEO H1
```

Then visually verify in browser that the explorer renders (taxonomy grids, document table, manifest download, language bars) - all of that is identical to today's behavior since the JS is byte-for-byte the same.

Out of scope (still queued):

  • PR 3c (#24): rename `apps/web` -> `apps/site`, `apps/web/worker` -> `apps/api`

Moves apps/web/public/index.html into apps/web/src/pages/index.astro so
the homepage now participates in the Astro build pipeline (same as the
4 content pages and the type/topic dynamic routes).

The change is minimal by intent:
- Frontmatter comment explaining the file's relationship to Layout.astro
  (it intentionally doesn't use Layout because the homepage has its own
  brand chrome and a richer Dataset JSON-LD structure than the shared one)
- The inline gtag config script gets 'is:inline' so Astro doesn't try to
  bundle/transpile it
- The inline CSS block gets 'is:global is:inline' to preserve the
  unscoped legacy stylesheet verbatim
- The body explorer JS gets 'is:inline' for the same reason

Everything else is untouched: explorer JS, SEO meta, OG/Twitter brand
tagline, Dataset JSON-LD with variableMeasured/inLanguage/measurementTechnique,
favicon paths, About section static links, footer.

Verified locally:
- bun run --cwd apps/web build -> 26 pages built in 18s (was 25, +index.html)
- bun run --cwd apps/web typecheck -> 0 errors
- dist/index.html has the SEO title, brand-tagline og:title, full
  JSON-LD, 19 unique /types/*+/topics/* static links, all explorer JS
  globals (renderTypesGrid, fetchDocuments, manifest-btn)
- dist/index.html: 43.7 KB (legacy was ~45 KB; Astro minified the markup)
@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caio-pizzol caio-pizzol merged commit 6407c4d into main May 19, 2026
2 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/port-homepage-to-astro branch May 19, 2026 18:48
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