* landing: convert main CTA to sign-up, add shared marketing layout - Replace email waitlist form with "Try now" sign-up button as primary CTA - Add shared _marketing layout route with consistent nav (Pricing, GitHub, Sign in) - Move email form to bottom of homepage as "Stay in the loop" newsletter - Update self-host card copy for live managed version - Reorder self-host card below video on mobile via flex order - Add /pricing to sitemap and SiteFooter * change footer and add social card * landing: move newsletter and footer to shared marketing layout Move divider line above the newsletter form instead of between the form and footer links.
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
import { existsSync, statSync, writeFileSync } from "node:fs";
|
|
import { dirname, join } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
const DIST_DIR = join(__dirname, "../dist/client");
|
|
|
|
const DEFAULT_SITE_URL = "https://openseo.so";
|
|
const SITE_URL = (process.env.SITE_URL ?? DEFAULT_SITE_URL).replace(/\/+$/, "");
|
|
|
|
const STATIC_PATHS = new Set(["/", "/pricing", "/privacy", "/terms-and-conditions"]);
|
|
|
|
function toCanonicalUrl(path) {
|
|
if (path === "/") {
|
|
return `${SITE_URL}/`;
|
|
}
|
|
|
|
return `${SITE_URL}${path.replace(/\/+$/, "")}`;
|
|
}
|
|
|
|
function main() {
|
|
if (!existsSync(DIST_DIR) || !statSync(DIST_DIR).isDirectory()) {
|
|
throw new Error(`Build output directory does not exist: ${DIST_DIR}`);
|
|
}
|
|
|
|
const urlPaths = new Set(STATIC_PATHS);
|
|
|
|
const urls = Array.from(urlPaths)
|
|
.map((path) => toCanonicalUrl(path))
|
|
.sort((a, b) => a.localeCompare(b));
|
|
|
|
const lastmod = new Date().toISOString();
|
|
const sitemapBody = urls
|
|
.map(
|
|
(url) =>
|
|
` <url>\n <loc>${url}</loc>\n <lastmod>${lastmod}</lastmod>\n </url>`,
|
|
)
|
|
.join("\n");
|
|
|
|
const sitemapXml = `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${sitemapBody}\n</urlset>\n`;
|
|
|
|
const sitemapPath = join(DIST_DIR, "sitemap.xml");
|
|
writeFileSync(sitemapPath, sitemapXml);
|
|
|
|
console.log(`Generated sitemap with ${urls.length} URLs at ${sitemapPath}`);
|
|
}
|
|
|
|
main();
|