diff --git a/nixite/md.nix b/nixite/md.nix index a466c80..25845f3 100644 --- a/nixite/md.nix +++ b/nixite/md.nix @@ -7,13 +7,13 @@ in rec { then processStr (builtins.readFile md) else processStr md; - recReadMd = root: + recReadMd = toPage: root: assert builtins.isPath root; builtins.mapAttrs (path: type: if type == "directory" then recReadMd (root + (/. + path)) else if type == "regular" - then mdToPage (root + (/. + path)) + then toPage (processMd (root + (/. + path))) else throw "Cannot read ${path}, file type ${type}") (builtins.readDir root); recFixAppendix = site: @@ -28,13 +28,7 @@ in rec { fixAppendix = builtins.replaceStrings [".md"] [".html"]; - readDir = root: recFixAppendix (recReadMd root); - - mdToPage = md: - html.document { - head = []; - body = elems.main (elems.article (processMd md)); - }; + readDir = toPage: root: recFixAppendix (recReadMd toPage root); splitList = block: map listItem (builtins.filter (s: builtins.isString s && s != "")