Skip to content

Commit 6407c4d

Browse files
caiopizzolcaio-pizzol
authored andcommitted
feat(web): port homepage to Astro static page
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)
1 parent f6d577b commit 6407c4d

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
---
2+
// Homepage. Ported from the legacy static apps/web/public/index.html so it
3+
// participates in the Astro build pipeline. Inline CSS and JS are preserved
4+
// verbatim under `is:global is:inline` and `is:inline` respectively; the
5+
// explorer JS still fetches live data from api.docxcorp.us at runtime, same
6+
// as before.
7+
//
8+
// This page intentionally doesn't use the shared Layout.astro because its
9+
// header/footer chrome and SEO metadata (custom og:title brand tagline,
10+
// twitter:description with "The missing dataset" copy, full Dataset JSON-LD
11+
// with variableMeasured/inLanguage/measurementTechnique) differ from the
12+
// shared one. The other Astro pages still go through Layout.
13+
---
14+
115
<!DOCTYPE html>
216
<html lang="en">
317

418
<head>
519
<!-- Google tag (gtag.js) -->
620
<script async src="https://www.googletagmanager.com/gtag/js?id=G-C9QG5MXVL5"></script>
7-
<script>
21+
<script is:inline>
822
window.dataLayer = window.dataLayer || [];
923
function gtag() { dataLayer.push(arguments); }
1024
gtag('js', new Date());
@@ -77,7 +91,7 @@
7791
as="style" onload="this.onload=null;this.rel='stylesheet'">
7892
<noscript><link rel="stylesheet"
7993
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap"></noscript>
80-
<style>
94+
<style is:global is:inline>
8195
* {
8296
margin: 0;
8397
padding: 0;
@@ -1123,7 +1137,7 @@ <h1>The largest open DOCX dataset and document corpus. 736K classified Word docu
11231137
</div>
11241138
</div>
11251139

1126-
<script>
1140+
<script is:inline>
11271141
(function () {
11281142
// ---------- state (seed from URL params) ----------
11291143
const _params = new URLSearchParams(window.location.search);

0 commit comments

Comments
 (0)