const fs = require('fs'); const path = require('path'); const filePath = path.join(__dirname, '../src/lib/blog-data.ts'); let content = fs.readFileSync(filePath, 'utf-8'); // Fix the date formatting issue in metadata divs // Replace "undefined NaN, NaN" with proper formatted dates from the post data const postRegex = /slug:\s*"([^"]+)"[\s\S]*?date:\s*"([^"]+)"[\s\S]*?updatedAt:\s*"([^"]+)"[\s\S]*?
{ const pattern = new RegExp( `(