--- import Base from '../../layouts/Base.astro'; import fs from 'node:fs'; import path from 'node:path'; export function getStaticPaths() { const dataDir = path.join(process.cwd(), 'src/data/comics'); if (!fs.existsSync(dataDir)) return []; const files = fs.readdirSync(dataDir).filter(f => f.endsWith('.html')); return files.map(file => { const slug = file.replace('.html', ''); return { params: { slug }, props: { filePath: path.join(dataDir, file) } }; }); } const { filePath } = Astro.props; const html = fs.readFileSync(filePath, 'utf-8'); // Extract title const titleMatch = html.match(/