19 lines
511 B
JavaScript
19 lines
511 B
JavaScript
import fs from 'fs';
|
|
|
|
let faqPath = 'src/app/faq/page.tsx';
|
|
let faq = fs.readFileSync(faqPath, 'utf8');
|
|
|
|
const importStatement = "import FaqHeroBg from '@/assets/faq/hero-bg.jpg';\n";
|
|
if (!faq.includes('FaqHeroBg')) {
|
|
// Inject after first import
|
|
faq = faq.replace(/(import [^\n]+\n)/, `$1${importStatement}`);
|
|
}
|
|
|
|
faq = faq.replace(
|
|
/"https:\/\/images\.unsplash\.com\/photo-1555396273-367ea4eb4db5[^"]+"/,
|
|
"{FaqHeroBg}"
|
|
);
|
|
|
|
fs.writeFileSync(faqPath, faq);
|
|
console.log("FAQ page updated successfully!");
|