diff --git a/index.md b/index.md index 04b3974..8434f2b 100644 --- a/index.md +++ b/index.md @@ -4,6 +4,4 @@ ## Posts -$render{"test"} - - [recursive]($root/posts/2023-08-03-recursively-list-all-files-in-a-directory-with-elixir.html) diff --git a/site.moon b/site.moon index 659d259..d6a25a9 100644 --- a/site.moon +++ b/site.moon @@ -1,7 +1,7 @@ sitegen = require "sitegen" -lfs = require "lfs" tools = require "sitegen.tools" site = require "sitegen.site" +lfs = require "lfs" rootname = (str) -> result = string.gsub str, "%..+", "" @@ -18,22 +18,9 @@ posts = (path=".") -> files = [file for file in lfs.dir path when file != "." and file != ".."] {join(path, file), target(file, "/posts") for _, file in ipairs files} --- renderer = require "sitegen.renderers.html" - - -- Change output dir to what Openresty prefers --- site = site! --- site.config.out_dir = "html/" - --- oof = site! - --- templates = site.templates - --- require"moon".p [k for k,v in pairs templates] --- require"moon".p [k for k,v in pairs site.templates] --- require"moon".p templates --- require"moon".p renderer.Renderer.can_load("test.md") --- require"moon".p renderer\helpers! +site = site! +site.config.out_dir = "html/" css = tools.system_command "cat < %s > %s", "css" @@ -41,8 +28,8 @@ sitegen.create => @title = "Hello World" @app_name = "stasis" @version = "0.2.12" - add "index.md" - add path, target: target for path, target in pairs posts "docs" + add "index.md" + add path, target: out, template: "blog" for path, out in pairs posts "docs" build css, "app.css" diff --git a/templates/blog.html b/templates/blog.html new file mode 100644 index 0000000..cf5ec94 --- /dev/null +++ b/templates/blog.html @@ -0,0 +1,11 @@ +$render{"templates/root"} + +
+

Web Log

+

Elixir, JavaScript, SVG, Containers, Git, Linux

+

+ Questions, comments, feedback? Contact the author. +

+
+ +$body diff --git a/templates/index.html b/templates/index.html index 3eeb34e..87432f8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,3 +1,5 @@ +$render{"templates/root"} +
$body