#!/usr/bin/env node // Renders crawlable static pages from services-data.js + projects-data.js: // /services/index.html, /services//index.html, /projects/index.html, // /projects//index.html, plus sitemap.xml. Node stdlib only. import fs from "node:fs"; import path from "node:path"; import vm from "node:vm"; const ROOT = path.dirname(new URL(import.meta.url).pathname); const SITE = "https://wilddragon.net"; const TODAY = new Date().toISOString().slice(0, 10); const win = { __R: (p) => "/" + p }; vm.runInNewContext(fs.readFileSync(path.join(ROOT, "projects-data.js"), "utf8"), { window: win, __R: win.__R }); vm.runInNewContext(fs.readFileSync(path.join(ROOT, "services-data.js"), "utf8"), { window: win }); const { PROJECTS, SERVICE_PAGES, SERVICE_AREAS, LOCATION_PAGES } = win; const esc = (s) => String(s).replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ }[c])); const abs = (p) => (p.startsWith("http") ? p : SITE + (p.startsWith("/") ? p : "/" + p)); const write = (rel, html) => { const f = path.join(ROOT, rel); fs.mkdirSync(path.dirname(f), { recursive: true }); fs.writeFileSync(f, html); }; const NAV = `
`; const FOOTER = `
`; // ponytail: page-local CSS instead of touching styles.css — the SPA never renders these pages. const STYLE = ``; function page({ url, title, description, image, ld, body, breadcrumb }) { const crumbs = { "@type": "BreadcrumbList", itemListElement: breadcrumb.map(([name, item], i) => ({ "@type": "ListItem", position: i + 1, name, item: abs(item) })) }; return ` ${esc(title)} ${STYLE} ${NAV} ${body} ${FOOTER} `; } const BUSINESS_ID = SITE + "/#organization"; const projectCard = (p) => `${esc(p.client)}${esc(p.title)}`; // ── service pages ────────────────────────────────────────────────────────── for (const s of SERVICE_PAGES) { const url = `/services/${s.slug}/`; const related = s.related.map((slug) => PROJECTS.find((p) => p.slug === slug)).filter(Boolean); const ld = [ { "@type": "Service", "@id": abs(url) + "#service", name: s.title, description: s.metaDescription, url: abs(url), provider: { "@id": BUSINESS_ID }, areaServed: SERVICE_AREAS.map((n) => ({ "@type": "Place", name: n })), serviceType: s.title, hasOfferCatalog: { "@type": "OfferCatalog", name: s.title, itemListElement: s.services.map(([n, d]) => ({ "@type": "Offer", itemOffered: { "@type": "Service", name: n, description: d } })) } }, { "@type": "FAQPage", mainEntity: s.faq.map(([q, a]) => ({ "@type": "Question", name: q, acceptedAnswer: { "@type": "Answer", text: a } })) }, ]; const body = `
${esc(s.eyebrow)}

${esc(s.title)}

${esc(s.lede)}

Request a consultation

${s.body.map((p) => `

${esc(p)}

`).join("")}

What's included

${s.services.map(([n, d]) => `

${esc(n)}

${esc(d)}

`).join("")}

Service area

${SERVICE_AREAS.map(esc).join(" · ")}

${LOCATION_PAGES.map((l) => `${esc(l.title)}`).join(" · ")}

Frequently asked questions

${s.faq.map(([q, a]) => `
${esc(q)}
${esc(a)}
`).join("")}
${related.length ? `

Related projects

` : ""}
`; write(url + "index.html", page({ url, title: s.metaTitle, description: s.metaDescription, image: s.hero, ld, body, breadcrumb: [["Home", "/"], ["Services", "/services/"], [s.title, url]] })); } // ── project pages ────────────────────────────────────────────────────────── for (const p of PROJECTS) { const url = `/projects/${p.slug}/`; const desc = p.summary.length > 158 ? p.summary.slice(0, 155).replace(/\s+\S*$/, "") + "…" : p.summary; const ld = [{ "@type": "Article", "@id": abs(url) + "#article", headline: p.title, description: p.summary, image: abs(p.thumbnail), url: abs(url), author: { "@id": SITE + "/#person" }, publisher: { "@id": BUSINESS_ID }, about: { "@type": "Organization", name: p.client }, keywords: [p.category, ...(p.technologies || [])].join(", ") }]; const body = `
${esc(p.title)}
${esc(p.category)} · ${esc(p.year)}

${esc(p.title)}

${esc(p.summary)}

${p.projectCredit ? `

A project by ${esc(p.projectCredit.name)}.
${esc(p.projectCredit.role)}

` : ""}
${p.description.map((t) => `

${esc(t)}

`).join("")}
${p.gallery?.length ? `

Inside the facility

${p.gallery.map(image => `${esc(image.alt)}`).join("")}
` : ""} ${p.highlights ? `

Highlights

    ${p.highlights.map((h) => `
  • ${esc(h)}
  • `).join("")}
` : ""} ${p.scope ? `

Scope

${p.scope.map((t) => `${esc(t)}`).join("")}
` : ""} ${p.technologies ? `

Technologies

${p.technologies.map((t) => `${esc(t)}`).join("")}
` : ""}
`; write(url + "index.html", page({ url, title: `${p.title} | Case Study | Wild Dragon`, description: desc, image: p.thumbnail, ld, body, breadcrumb: [["Home", "/"], ["Projects", "/projects/"], [p.title, url]] })); } // ── index pages ──────────────────────────────────────────────────────────── write("services/index.html", page({ url: "/services/", title: "AV & Broadcast Integration Services | Washington DC | Wild Dragon", description: "Commercial AV installation, broadcast systems integration, LED video walls, and conference room AV — designed, installed, and commissioned in Washington, DC and the DMV.", image: "images/wild-dragon-logo.jpg", ld: [], breadcrumb: [["Home", "/"], ["Services", "/services/"]], body: `
Services · Washington, DC

AV & broadcast integration services

Design, installation, and commissioning for commercial AV and broadcast facilities across the DMV.

` })); write("projects/index.html", page({ url: "/projects/", title: "Broadcast & AV Integration Case Studies | Wild Dragon", description: "Case studies: broadcast facilities, cloud production, XR stages, and AV integration for the Washington Commanders, BetMGM, CVS/Aetna, UBS, Monumental Sports, Intuit, and Red Sands.", image: "images/photos/production-switcher.jpg", ld: [], breadcrumb: [["Home", "/"], ["Projects", "/projects/"]], body: `
Selected work

Case studies

Facilities designed, integrated, and commissioned by Wild Dragon.

` })); // ── location / keyword pages ─────────────────────────────────────────────── for (const l of LOCATION_PAGES) { const url = `/${l.slug}/`; const svcs = l.services.map((slug) => SERVICE_PAGES.find((s) => s.slug === slug)).filter(Boolean); const related = l.related.map((slug) => PROJECTS.find((p) => p.slug === slug)).filter(Boolean); const ld = [ { "@type": "Service", "@id": abs(url) + "#service", name: l.title, description: l.metaDescription, url: abs(url), provider: { "@id": BUSINESS_ID }, areaServed: SERVICE_AREAS.map((n) => ({ "@type": "Place", name: n })), serviceType: l.title }, { "@type": "FAQPage", mainEntity: l.faq.map(([q, a]) => ({ "@type": "Question", name: q, acceptedAnswer: { "@type": "Answer", text: a } })) }, ]; const body = `
${esc(l.eyebrow)}

${esc(l.title)}

${esc(l.lede)}

Request a consultation

${l.body.map((p) => `

${esc(p)}

`).join("")}

Services

Service area

${SERVICE_AREAS.map(esc).join(" · ")}

Frequently asked questions

${l.subpages ? `

See also: ${l.subpages.map((sl) => LOCATION_PAGES.find((x) => x.slug === sl)).filter(Boolean).map((x) => `${esc(x.title)}`).join(" · ")}

` : ""}
${l.faq.map(([q, a]) => `
${esc(q)}
${esc(a)}
`).join("")}
${related.length ? `

Related projects

` : ""}
`; write(url + "index.html", page({ url, title: l.metaTitle, description: l.metaDescription, image: l.hero, ld, body, breadcrumb: [["Home", "/"], [l.title, url]] })); } // ── legal pages (generic boilerplate) ───────────────────────────────────── const EFFECTIVE = "November 10, 2026"; const MAIL = `zgaetano@wilddragon.net`; const LEGAL = [ { slug: "privacy", title: "Privacy Policy", description: "How Wild Dragon LLC collects, uses, and protects information when you visit wilddragon.net or contact us.", sections: [ ["Overview", `This Privacy Policy explains how Wild Dragon LLC ("Wild Dragon," "we," "us") handles information when you visit wilddragon.net (the "Site") or contact us. By using the Site, you agree to this Policy.`], ["Information we collect", `Information you provide. If you email us, we receive your name, email address, and anything you include in your message.

Information collected automatically. Like most websites, our hosting and content-delivery providers automatically log technical data such as IP address, browser type, device information, referring page, and the date and time of your request. The Site does not use advertising cookies, analytics trackers, or contact forms.`], ["How we use information", `We use information to respond to inquiries, provide and quote our services, operate, secure, and improve the Site, and comply with legal obligations. We do not sell or rent your personal information.`], ["Third-party services", `The Site is delivered through Cloudflare, which may process request data and set strictly necessary security cookies. Fonts are loaded from Google Fonts, which receives your IP address when the page loads. These providers handle data under their own privacy policies.`], ["Sharing", `We share information only with service providers who help us operate our business, when required by law or to protect our rights, or in connection with a merger, acquisition, or sale of assets.`], ["Retention", `We keep information only as long as needed for the purposes described above or as required by law.`], ["Security", `We use reasonable safeguards to protect information, but no method of transmission or storage is completely secure.`], ["Your choices and rights", `Depending on where you live, you may have the right to request access to, correction of, or deletion of your personal information. To make a request, email ${MAIL}.`], ["Children", `The Site is not directed to children under 13, and we do not knowingly collect their personal information.`], ["External links", `The Site may link to third-party websites. We are not responsible for their content or privacy practices.`], ["Changes", `We may update this Policy from time to time. Changes take effect when posted on this page with a new effective date.`], ["Contact", `Questions about this Policy: ${MAIL}.`], ] }, { slug: "terms", title: "Terms of Service", description: "The terms that govern your use of wilddragon.net, operated by Wild Dragon LLC.", sections: [ ["Acceptance of terms", `These Terms of Service ("Terms") govern your use of wilddragon.net (the "Site"), operated by Wild Dragon LLC ("Wild Dragon," "we," "us"). By accessing or using the Site, you agree to these Terms. If you do not agree, do not use the Site.`], ["Use of the Site", `You may use the Site for lawful, informational purposes only. You agree not to interfere with or disrupt the Site, attempt to gain unauthorized access to it or its systems, or use automated means to scrape or overload it.`], ["Intellectual property", `All content on the Site, including text, graphics, logos, photographs, and design, is owned by Wild Dragon LLC or its licensors and is protected by intellectual property laws. Client names and marks belong to their respective owners and are shown for identification only. You may not copy, reproduce, or distribute Site content without our prior written permission.`], ["No professional advice or offer", `Content on the Site is provided for general information only. It is not engineering, legal, or other professional advice, and it is not an offer to provide services. Any engagement is governed by a separate written agreement between you and Wild Dragon LLC.`], ["Third-party links", `The Site may contain links to third-party websites. We do not control and are not responsible for their content, policies, or practices.`], ["Disclaimer of warranties", `THE SITE IS PROVIDED "AS IS" AND "AS AVAILABLE," WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. We do not warrant that the Site will be uninterrupted, error-free, or free of harmful components.`], ["Limitation of liability", `TO THE FULLEST EXTENT PERMITTED BY LAW, WILD DRAGON LLC WILL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS, DATA, OR GOODWILL, ARISING FROM YOUR USE OF OR INABILITY TO USE THE SITE.`], ["Indemnification", `You agree to indemnify and hold harmless Wild Dragon LLC from any claims, damages, or expenses arising from your misuse of the Site or violation of these Terms.`], ["Governing law", `These Terms are governed by the laws of the jurisdiction in which Wild Dragon LLC is organized, without regard to conflict-of-law principles.`], ["Changes", `We may revise these Terms at any time. Changes take effect when posted on this page with a new effective date. Your continued use of the Site means you accept the revised Terms.`], ["Contact", `Questions about these Terms: ${MAIL}.`], ] }, ]; for (const L of LEGAL) { const url = `/${L.slug}/`; const body = `

Legal

${L.title}

Effective ${EFFECTIVE}

${L.sections.map(([h, t]) => `

${h}

${t}

`).join("\n")}
`; write(url + "index.html", page({ url, title: `${L.title} | Wild Dragon`, description: L.description, image: "images/dragon-mark.png", ld: [], body, breadcrumb: [["Home", "/"], [L.title, url]] })); } // ── sitemap ──────────────────────────────────────────────────────────────── const urls = [["/", "1.0"], ["/services/", "0.9"], ...SERVICE_PAGES.map((s) => [`/services/${s.slug}/`, "0.9"]), ...LOCATION_PAGES.map((l) => [`/${l.slug}/`, "0.9"]), ["/projects/", "0.7"], ...PROJECTS.map((p) => [`/projects/${p.slug}/`, "0.7"]), ["/privacy/", "0.2"], ["/terms/", "0.2"]]; write("sitemap.xml", ` ${urls.map(([u, pr]) => ` ${abs(u)}${TODAY}${pr}`).join("\n")} `); console.log(`built ${SERVICE_PAGES.length} service + ${LOCATION_PAGES.length} location + ${PROJECTS.length} project pages, sitemap ${urls.length} urls`);