all repos — kushiyaki @ 6bcc5689a45b3115121066f167b15ca839a076a8

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

fix: remove parsing/formatting from hastx processor
trickyni trickyniv56@gmail.com
Fri, 08 May 2026 20:57:58 +0300
commit

6bcc5689a45b3115121066f167b15ca839a076a8

parent

f234f8efc590c7b7ab85b5aacdc88df69f5cc4fa

1 files changed, 3 insertions(+), 11 deletions(-)

jump to
M writeComponent.jswriteComponent.js

@@ -1,16 +1,8 @@

import { unified } from "unified"; import rehypeStringify from "rehype-stringify"; -import rehypeFormat from "rehype-format"; -import rehypeParse from "rehype-parse"; -import rehypeRaw from "rehype-raw"; export async function writeComponent(componentName, data = {}) { - const fn = await import(`./input/templates/${componentName}.jsx`); - const jsxProcessor = unified() - .use(rehypeParse, { fragment: true }) - .use(rehypeRaw) - .use(rehypeFormat) - .use(rehypeStringify); - - return jsxProcessor.stringify(await jsxProcessor.run(fn.default(data))); + const fn = await import(`./input/templates/${componentName}.jsx`); //FIX avoid strict filestruct past "input" + return unified().use(rehypeStringify).stringify(fn.default(data)); } +console.log(await writeComponent("booknav", { page: "1" }));