feat(web): port homepage to Astro static page (PR 3b)#14
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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:
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):