all repos — kushiyaki @ 0080fdaaa3e6d18ba1878d7e036465db026739c3

🍢 A tiny static site generator for grilling markdown files to perfection

feat: integrate joinComponents
trickyni trickyniv56@gmail.com
Thu, 30 Apr 2026 17:16:41 +0300
commit

0080fdaaa3e6d18ba1878d7e036465db026739c3

parent

3c70b9e05ed0717e5ca98b1270444c2f15e0c177

1 files changed, 12 insertions(+), 27 deletions(-)

jump to
M looper.jslooper.js

@@ -1,31 +1,16 @@

-import { extractFrontmatter } from "./extractFrontmatter"; -import { writePage } from "./writePage"; -import { copy, emptyDir, ensureDir, writeFile, readdir } from "fs-extra"; +import { emptyDir, writeFile } from "fs-extra"; +import { joinComponents } from "./joinComponents"; import cpy from "cpy"; -import glob from "glob"; +import { glob } from "glob"; //mise en place -await emptyDir("out/", { recursive: true }); // clears the output folder -await ensureDir("out/assets"); -await cpy("./input/assets", "./out/assets", { flat: true }); +await emptyDir("out", { recursive: true }); // clears the output folder +await cpy("input/assets", "out", { flat: true }); //copies all the assets into out/ -const contentDir = await glob("./input/content/", { - nodir: true, - withFileTypes: true, -}); - -await Promise.all( - contentDir - .filter((f) => f.isFile()) - .map((f) => console.log(extractFrontmatter(f.path))), -); -// for (let file of contentDir) { -// if (file.isFile()) { -// console.log(await extractFrontmatter(file.path)); -// } -// } - -// async function indexSite() { -// const -// return -// } +for (const file of await glob("input/content/**/*", { nodir: true })) { + console.log(file); + await writeFile( + file.replace("input/content", "out").replace(".md", ".html"), + await joinComponents(file), + ); +}