Add RSS, sitemap, and local dotted-file drafts.
Deploy website / deploy (push) Successful in 32s

This commit is contained in:
2026-09-04 21:41:52 -04:00
parent 88d401198a
commit 0f69028d4a
6 changed files with 252 additions and 18 deletions
+17 -2
View File
@@ -19,6 +19,21 @@ function generatedPages(directory) {
return inputs
}
function copyGeneratedFiles() {
const files = ['feed.xml', 'sitemap.xml']
return {
name: 'copy-generated-files',
closeBundle() {
const dist = path.resolve('dist')
if (!fs.existsSync(dist)) return
for (const file of files) {
const source = path.resolve('.generated', file)
if (fs.existsSync(source)) fs.copyFileSync(source, path.join(dist, file))
}
},
}
}
function contentGenerator() {
let timer
let generator
@@ -30,7 +45,7 @@ function contentGenerator() {
return
}
generator = spawn(process.execPath, ['generator.js'], { stdio: 'inherit' })
generator = spawn(process.execPath, ['generator.js', '--drafts'], { stdio: 'inherit' })
generator.on('error', (error) => {
console.error(`Content generation failed: ${error.message}`)
})
@@ -77,7 +92,7 @@ function contentGenerator() {
}
export default defineConfig({
plugins: [contentGenerator()],
plugins: [contentGenerator(), copyGeneratedFiles()],
root: '.generated',
publicDir: '../public',
resolve: {