feat: unenforce file structure from globs
trickyni trickyniv56@gmail.com
Fri, 08 May 2026 20:56:36 +0300
2 files changed,
5 insertions(+),
5 deletions(-)
M
createSiteIndex.js
→
createSiteIndex.js
@@ -3,7 +3,7 @@ import { glob } from "glob";
export async function createSiteIndex() { let siteIndex = []; - for (const file of await glob("input/content/**/*", { nodir: true })) { + for (const file of await glob("input/**/*.md", { nodir: true })) { siteIndex.push(await extractFrontmatter(file)); } return siteIndex;
M
looper.js
→
looper.js
@@ -1,15 +1,15 @@
-import { emptyDir, writeFile } from "fs-extra"; +import { emptyDir, ensureDir, ensureFile, writeFile } from "fs-extra"; import { joinComponents } from "./joinComponents"; import cpy from "cpy"; import { glob } from "glob"; //mise en place await emptyDir("out", { recursive: true }); // clears the output folder -await cpy("input/assets", "out", { flat: true }); //copies all the assets into out/ +await cpy(["input/**", "!input/**/*{.md,.jsx}"], "out", { flat: true }); //copies all the assets into out/ -for (const file of await glob("input/content/**/*", { nodir: true })) { +for (const file of await glob("input/**/*.md", { nodir: true })) { await writeFile( - file.replace(/input\/content[\/\w]*\//, "out/").replace(".md", ".html"), + file.replace(/input[\/\w]*\//, "out/").replace(".md", ".html"), await joinComponents(file), ); }