- New TinaCMS collection 'pages' with 15 block templates: Hero, TextBlock, TwoColumn, Features, Stats, Testimonials, Team, FAQ, CTABanner, Video, Gallery, Pricing, Timeline, Divider, ContactForm - Each page has published toggle (unpublished → 404) - Route /p/:slug renders dynamic pages from content/pages/*.json - scripts/copy-pages.mjs copies content/pages → public/pages at build - prerender.mjs extended to prerender published pages - All blocks styled with design tokens + Framer Motion animations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
741 B
JavaScript
22 lines
741 B
JavaScript
import { readdirSync, copyFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
import { resolve, dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
const root = resolve(__dirname, '..');
|
|
const src = resolve(root, 'content/pages');
|
|
const dest = resolve(root, 'public/pages');
|
|
|
|
if (!existsSync(src)) {
|
|
console.log('No content/pages directory, skipping.');
|
|
process.exit(0);
|
|
}
|
|
|
|
mkdirSync(dest, { recursive: true });
|
|
|
|
const files = readdirSync(src).filter(f => f.endsWith('.json'));
|
|
for (const file of files) {
|
|
copyFileSync(resolve(src, file), resolve(dest, file));
|
|
console.log(`Copied: ${file}`);
|
|
}
|
|
console.log(`Pages copy complete: ${files.length} file(s).`);
|