From d7bffb9f979a3b89a098dbda84e371b81c302999 Mon Sep 17 00:00:00 2001 From: yaroslav Date: Tue, 20 Jan 2026 19:30:54 +0200 Subject: [PATCH] restart the build when adding a new page --- gulpfile.js | 5 ++--- src/pages/example/example.html | 11 +++++++++++ src/pages/page2/page2.html | 0 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/pages/example/example.html create mode 100644 src/pages/page2/page2.html diff --git a/gulpfile.js b/gulpfile.js index 936adef..a3fe47c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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: '@@', diff --git a/src/pages/example/example.html b/src/pages/example/example.html new file mode 100644 index 0000000..6a0fe18 --- /dev/null +++ b/src/pages/example/example.html @@ -0,0 +1,11 @@ + + + + + + Example page + + + + + \ No newline at end of file diff --git a/src/pages/page2/page2.html b/src/pages/page2/page2.html new file mode 100644 index 0000000..e69de29