restart the build when adding a new page

This commit is contained in:
yaroslav
2026-01-20 19:30:54 +02:00
parent bca991ccaa
commit d7bffb9f97
3 changed files with 13 additions and 3 deletions
+2 -3
View File
@@ -18,13 +18,12 @@ async function listDir(directoryPath) {
}
const dir = import.meta.dirname
const pages = await listDir('./src/pages')
async function html() {
console.log(`resync...`)
const pages = await listDir('./src/pages')
pages.forEach(page=>{
if(existsSync(`${dir}/src/pages/${page}/${page}.html`)){
console.log(`we find page ${page}!`)
return src([`./src/pages/${page}/${page}.html`])
.pipe(fileinclude({
prefix: '@@',
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Example page</title>
</head>
<body>
</body>
</html>
View File