import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const mainDirectory = 'https://www.pozo.app'; const routes = [ { path: "index.html", pageId: 1, url: `${mainDirectory}/`}, { path: "signin/index.html", pageId: 2, url: `${mainDirectory}/signin` }, { path: "home/pricing-pozoapp/index.html", pageId: 3, url: `${mainDirectory}/pricing` }, { path: "contact-us/index.html", pageId: 4, url: `${mainDirectory}/contact-us` }, { path: "blog/index.html", pageId: 5, url: `${mainDirectory}/blog` }, { path: "about-us/index.html", pageId: 6, url: `${mainDirectory}/about-us` }, { path: "solutions/index.html", pageId: 9, url: `${mainDirectory}/solutions` }, ]; const seoData = { 1: { title: "Retail ERP & POS for Indian MSMEs | POZO", description: "Fast billing, smart inventory, GST-ready POS. POZO helps kirana, mini-supermarkets & retail chains speed checkout, connect weighing scales, and manage multi-store ops.", keywords: "retail ERP, POS software, billing software, inventory management, GST billing, kirana store, mini supermarket, weighing scale POS, multi-store ERP, Indian retail software", image: `${mainDirectory}/og/home.jpg`, }, 2: { title: "Sign In to PozoApp | Retail ERP & POS Login", description: "Access your business dashboard. Sign in to POZO retail ERP & POS system for billing, inventory management, and business analytics.", keywords: "POZO login, retail ERP login, POS software login, business dashboard, billing software access, inventory management login", image: `${mainDirectory}/og/Signin-og.jpg`, }, 3: { title: "Pricing - Retail ERP & POS Plans | POZO", description: "Simple plans for MSMEs. Fast billing, inventory, GST e-invoice, weighing-scale integration, WhatsApp e-bills & multi-store controls. Book a demo.", keywords: "POZO pricing, retail ERP pricing, POS software cost, billing software price, inventory management pricing, GST software cost, MSME software pricing", image: `${mainDirectory}/og/pricing-og.jpg`, }, 4: { title: "Contact POZO | Retail ERP & POS Support", description: "Get support and sales information for POZO retail ERP & POS solutions. Contact us for billing software, inventory management, and business automation.", keywords: "POZO contact, retail ERP support, POS software support, billing software help, inventory management support, customer service, technical support", image: `${mainDirectory}/og/contact-og.jpg`, }, 5: { title: "POZO Blog — Retail ERP, POS & Grocery Billing Guides", description: "Practical guides on POS billing, weighing-scale integration, GST e-invoices, multi-store ERP & inventory control for Indian retailers.", keywords: "retail blog, POS guides, billing tutorials, inventory tips, GST billing guide, weighing scale integration, multi-store management, retail technology", image: `${mainDirectory}/og/blog-og.jpg`, }, 6: { title: "About POZO | Retail ERP & POS Solutions for MSMEs", description: "Learn about POZO's mission to digitize Indian retail businesses with affordable ERP & POS solutions, billing software, and inventory management.", keywords: "about POZO, retail digitization, MSME solutions, Indian retail software, ERP for small business, POS for kirana stores, retail technology company", image: `${mainDirectory}/og/about-og.jpg`, }, 9: { title: "Retail Solutions | ERP & POS Software for Every Business", description: "Comprehensive retail solutions: billing software, inventory management, GST compliance, weighing scale integration, and multi-store ERP for Indian businesses.", keywords: "retail solutions, comprehensive ERP, POS solutions, billing solutions, inventory solutions, GST compliance software, weighing scale POS, multi-store solutions", image: `${mainDirectory}/og/solutions-og.jpg`, }, }; async function generateSEOFiles() { for (const route of routes) { const pageSeo = seoData[route.pageId]; const filePath = path.join(__dirname, "../dist", route.path); fs.mkdirSync(path.dirname(filePath), { recursive: true }); let html; if (fs.existsSync(filePath)) { html = fs.readFileSync(filePath, "utf8"); } else { html = fs.readFileSync(path.join(__dirname, "../dist/index.html"), "utf8"); } // Remove ONLY SEO-specific tags, preserve verification and analytics html = html .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, '') .replace(/]*>/g, ''); // Replace title html = html.replace(/