#!/usr/bin/env node /** * Postbuild prerender script — injects critical SEO content into the built HTML * so search engines see real content without executing JavaScript. * * This is a lightweight SSG alternative: it embeds key text content * (headings, descriptions, FAQ answers) directly into the HTML body * as a hidden div that gets replaced when React hydrates. */ import { readFileSync, writeFileSync } from 'node:fs'; import { resolve, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; const __dirname = dirname(fileURLToPath(import.meta.url)); const htmlPath = resolve(__dirname, '../public/pro/index.html'); const en = JSON.parse(readFileSync(resolve(__dirname, 'src/locales/en.json'), 'utf-8')); const seoContent = `
${en.hero.subtitle}
${en.hero.missionLine}
${en.twoPath.proDesc}
${en.twoPath.proF1}
${en.twoPath.proF2}
${en.twoPath.proF3}
${en.twoPath.proF4}
${en.twoPath.entDesc}
${en.whyUpgrade.noiseDesc}
${en.whyUpgrade.fasterDesc}
${en.whyUpgrade.controlDesc}
${en.whyUpgrade.deeperDesc}
${en.proShowcase.subtitle}
${en.proShowcase.equityResearchDesc}
${en.proShowcase.geopoliticalAnalysisDesc}
${en.proShowcase.economyAnalyticsDesc}
${en.proShowcase.riskMonitoringDesc}
${en.proShowcase.morningBriefsDesc}
${en.proShowcase.oneKeyDesc}
${en.audience.investorsDesc}
${en.audience.tradersDesc}
${en.audience.researchersDesc}
${en.audience.journalistsDesc}
${en.audience.govDesc}
${en.audience.teamsDesc}
${en.dataCoverage.subtitle}
${en.apiSection.subtitle}
${en.enterpriseShowcase.subtitle}
${en.finalCta.subtitle}