47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const srcDir = path.join(__dirname, 'src');
|
|
const distDir = path.join(__dirname, 'dist');
|
|
|
|
if (!fs.existsSync(distDir)) {
|
|
fs.mkdirSync(distDir, { recursive: true });
|
|
}
|
|
|
|
// Simple build: copy static assets and generate index.html
|
|
const indexHtml = `<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Signal Ledger</title>
|
|
<link rel="stylesheet" href="/style.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Signal Ledger</h1>
|
|
<p class="tagline">Independent news. Clear signal.</p>
|
|
</header>
|
|
<main>
|
|
<p>Welcome to Signal Ledger — a subsidiary of Jopdorp.</p>
|
|
</main>
|
|
<footer>
|
|
<p>Signal Ledger is a subsidiary of Jopdorp.</p>
|
|
</footer>
|
|
</body>
|
|
</html>
|
|
`;
|
|
|
|
fs.writeFileSync(path.join(distDir, 'index.html'), indexHtml);
|
|
|
|
// Copy style.css if it exists
|
|
const styleSrc = path.join(srcDir, 'style.css');
|
|
const styleDest = path.join(distDir, 'style.css');
|
|
if (fs.existsSync(styleSrc)) {
|
|
fs.copyFileSync(styleSrc, styleDest);
|
|
} else {
|
|
fs.writeFileSync(styleDest, `body{font-family:system-ui,sans-serif;margin:0;padding:2rem;background:#0b0c10;color:#c5c6c7}header{border-bottom:1px solid #45a29e;padding-bottom:1rem;margin-bottom:2rem}h1{color:#66fcf1;margin:0}.tagline{color:#45a29e}footer{margin-top:4rem;padding-top:1rem;border-top:1px solid #45a29e;font-size:.875rem;color:#45a29e}`);
|
|
}
|
|
|
|
console.log('Build complete: dist/');
|