moved things to website dir

This commit is contained in:
2025-06-06 12:46:18 +10:00
parent 3df3240ddd
commit f2dbad9d4b
15 changed files with 14 additions and 210 deletions

View File

@@ -18,9 +18,13 @@ async function buildPage(pageName, outputName) {
const commonHeaderPath = path.join(__dirname, 'templates', '_header.html');
const commonFooterPath = path.join(__dirname, 'templates', '_footer.html');
const contentPath = path.join(__dirname, 'src', `${pageName}.html`);
const outputPath = path.join(__dirname, `${outputName}.html`);
const outputDir = path.join(__dirname, 'website');
const outputPath = path.join(outputDir, `${outputName}.html`);
try {
// Ensure the website directory exists
await fs.mkdir(outputDir, { recursive: true });
let layoutContent = await fs.readFile(layoutPath, 'utf-8');
const srcFileContent = await fs.readFile(contentPath, 'utf-8');
@@ -100,7 +104,7 @@ async function buildPage(pageName, outputName) {
console.log(`Successfully built ${outputPath}`);
} catch (error) {
console.error(`Error building page ${pageName}:`, error);
throw error;
throw error; // Re-throw to fail the build process if needed
}
}