all repos — kushiyaki @ 587d1182cf8f63818048daaa05ccf5e6b3887d9e

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

chore: clean comments/imports
trickyni trickyniv56@gmail.com
Tue, 05 May 2026 11:37:52 +0300
commit

587d1182cf8f63818048daaa05ccf5e6b3887d9e

parent

0080fdaaa3e6d18ba1878d7e036465db026739c3

6 files changed, 12 insertions(+), 24 deletions(-)

jump to
M bun.lockbun.lock

@@ -12,6 +12,7 @@ "glob": "^13.0.6",

"hastx": "^0.1.2", "js-yaml": "^4.1.1", "livereload": "^0.10.3", + "moderndash": "^4.0.2", "nunjucks": "^3.2.4", "react": "^19.2.1", "react-dom": "^19.2.1",

@@ -352,6 +353,8 @@ "hastscript": ["hastscript@8.0.0", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", "property-information": "^6.0.0", "space-separated-tokens": "^2.0.0" } }, "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw=="],

"hastx": ["hastx@0.1.2", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-vpfSyE9mwJsN3UT+9iyKZZQc2RRNnreii/uR+onvCcxlcL8f05L431irUiH8qzSu4bRp3+kFJjE8Nug8y0Apmw=="], + "hotscript": ["hotscript@1.0.13", "", {}, "sha512-C++tTF1GqkGYecL+2S1wJTfoH6APGAsbb7PAWQ3iVIwgG/EFseAfEVOKFgAFq4yK3+6j1EjUD4UQ9dRJHX/sSQ=="], + "html-void-elements": ["html-void-elements@3.0.0", "", {}, "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg=="], "html-whitespace-sensitive-tag-names": ["html-whitespace-sensitive-tag-names@3.0.1", "", {}, "sha512-q+310vW8zmymYHALr1da4HyXUQ0zgiIwIicEfotYPWGN0OJVEN/58IJ3A4GBYcEq3LGAZqKb+ugvP0GNB9CEAA=="],

@@ -506,6 +509,8 @@ "minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="],

"mkdirp": ["mkdirp@0.5.6", "", { "dependencies": { "minimist": "^1.2.6" }, "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw=="], + "moderndash": ["moderndash@4.0.2", "", { "dependencies": { "hotscript": "1.0.13", "type-fest": "5.4.4" } }, "sha512-8vROuMwvlYholwPd2IkDnWINEZKd8V53tq0Sq3ioQi92j+Y1szdbE9f1tmKd2NKhNZaeFucQfjAc9VMbyHdpeQ=="], + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], "nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],

@@ -628,6 +633,8 @@ "style-to-object": ["style-to-object@1.0.14", "", { "dependencies": { "inline-style-parser": "0.2.7" } }, "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw=="],

"supports-color": ["supports-color@9.4.0", "", {}, "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw=="], + "tagged-tag": ["tagged-tag@1.0.0", "", {}, "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng=="], + "through": ["through@2.3.8", "", {}, "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="], "tinyglobby": ["tinyglobby@0.2.16", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg=="],

@@ -643,6 +650,8 @@

"trough": ["trough@2.2.0", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="], "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "type-fest": ["type-fest@5.4.4", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-JnTrzGu+zPV3aXIUhnyWJj4z/wigMsdYajGLIYakqyOW1nPllzXEJee0QQbHj+CTIQtXGlAjuK0UY+2xTyjVAw=="], "ua-parser-js": ["ua-parser-js@0.7.41", "", { "bin": { "ua-parser-js": "script/cli.js" } }, "sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg=="],
M extractFrontmatter.jsextractFrontmatter.js

@@ -1,29 +1,19 @@

-import { readFile, writeFile } from "fs-extra"; import { unified } from "unified"; import remarkParse from "remark-parse"; import remarkStringify from "remark-stringify"; import remarkFrontmatter from "remark-frontmatter"; -import remarkRehype from "remark-rehype"; const yaml = require("js-yaml"); -// -//NOTE input: filepath. Output- frontmatter pairs in object -// export async function extractFrontmatter(filepath) { let frontmatterObj; - const processor = await unified() + await unified() .use(remarkParse) .use(remarkFrontmatter, "yaml") .use(() => (tree) => { frontmatterObj = yaml.load(tree.children[0].value); - //FIX something with vfiles - //TODO throw error on invalid frontmatter - frontmatterObj.filename = filepath.split("/").pop(); - frontmatterObj.filepath = filepath; + frontmatterObj.filename = filepath.split("/").pop().split(".").shift(); }) .use(remarkStringify) .process(await readFile(filepath, "utf-8")); return frontmatterObj; } - -// console.log(await extractFrontmatter("./input/content/index.md"));
M joinComponents.jsjoinComponents.js

@@ -48,4 +48,3 @@

const output = await processor.process(union); return output.value; } -// console.log(await joinComponents("./input/content/cookie.md"));
M package.jsonpackage.json

@@ -13,6 +13,7 @@ "glob": "^13.0.6",

"hastx": "^0.1.2", "js-yaml": "^4.1.1", "livereload": "^0.10.3", + "moderndash": "^4.0.2", "nunjucks": "^3.2.4", "react": "^19.2.1", "react-dom": "^19.2.1",
M writeComponent.jswriteComponent.js

@@ -14,5 +14,3 @@ .use(rehypeStringify);

return jsxProcessor.stringify(await jsxProcessor.run(fn.default(data))); } - -// console.log(await writeComponent("h2", { title: "blah" }));
M writePageMain.jswritePageMain.js

@@ -7,12 +7,6 @@ import remarkFrontmatter from "remark-frontmatter";

import rehypeFormat from "rehype-format"; import rehypeRaw from "rehype-raw"; import rehypeWrap from "rehype-wrap"; -// -//NOTE input: markdown -> MDAST -> HAST -> HTML -//TODO does not yet accept before/after JSX components. -//This is using unified's rehypeDocument to create a boilerplate with a few -//inserts (favicon, css, title) -// export async function writePageMain(filepath) { const processor = await unified()

@@ -26,6 +20,3 @@ .use(rehypeStringify)

.process(await readFile(filepath, "utf-8")); return processor.value; } - -// let input = "./input/content/cookie.md"; -// console.log(await writePageMain(input));