diff --git a/site.moon b/site.moon index f2bf82a..2371d60 100644 --- a/site.moon +++ b/site.moon @@ -10,6 +10,10 @@ path = require "sitegen.path" -- Change output dir to what Openresty prefers site.config.out_dir = "html/" +-- Deactivate "pygments" plugin +site.default_plugins = for v in *site.default_plugins + if v\find "pygments" then continue else v + rootname = (str) -> result = string.gsub str, "%..+", "" result @@ -31,7 +35,7 @@ format_date = (str) -> date(str)\fmt "%b %d, %Y" publish_date = (path) -> format_date extract_date path -- monkey-patch sitegen to use pandoc for markdown conversion -os.execute "moonc -t \ +os.execute "moonc -t \\ /usr/local/openresty/luajit/share/lua/5.1/sitegen/renderers/ markdown.moon" sitegen.create => @@ -39,11 +43,24 @@ sitegen.create => @app_name = "stasis" @version = "0.2.12" + -- add "test.md" + -- + -- filter "test", (body) => + -- body\gsub "%-%-%-.-%.%.%.", (yaml_header) -> + -- moonscript_header = yaml_header\gsub "%-%-%-", "{" + -- result = moonscript_header\gsub "%.%.%.", "}" + -- result + add "index.html" add path, target: out, template: "blog", is_a: "post", post: { publish_date: publish_date(path) }, id: extract_id(path) for path, out in pairs posts "docs" + filter "docs", (body) => + body\gsub "%-%-%-.-%.%.%.", (yaml_header) -> + moonscript_header = yaml_header\gsub "%-%-%-", "{" + result = moonscript_header\gsub "%.%.%.", "}" + result -- add "docs/2023-11-15-test-mix-task-file-modify.md", -- target: "posts/2023-11-15-test-mix-task-file-modify.html" -- template: "blog" @@ -55,10 +72,11 @@ sitegen.create => copy "app.css" - -- filter "docs", (body) => + -- filter "test", (body) => -- require("moon").p body -- filter "2023%-08%-03", (body) => + -- print "hello" -- table.concat { body, "

hey there

" } -- -- body\gsub "

.-

", (header) ->