diff --git a/README.md b/README.md index 27f5242..b5cf035 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +## requirements + +`pandoc` utility must be installed + +- Debian Bookworm: + + $ apt-get update && apt-get install -y pandoc + ## start default openresty 1. Run `docker run --rm -it --init -w /opt -v $PWD:/opt -p 80:80 openresty/openresty:1.27.1.2-0-bookworm-buildpack` @@ -33,7 +41,6 @@ } http { server { - root /opt/www; listen 8080; location / { default_type text/html; diff --git a/blog.html b/blog.html new file mode 100644 index 0000000..97ae205 --- /dev/null +++ b/blog.html @@ -0,0 +1,4 @@ +

Posts

+ + +$render{"posts"} diff --git a/index.html b/index.html index a03fad9..f5c0bed 100644 --- a/index.html +++ b/index.html @@ -11,3 +11,7 @@ $render{"templates/wares"} $render{"posts"} + +

+ View more posts +

diff --git a/site.moon b/site.moon index 2371d60..e74400a 100644 --- a/site.moon +++ b/site.moon @@ -43,45 +43,18 @@ 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: { + add "blog.html", target: "posts/index", template: "blog" + + add path, target: out, template: "post", is_a: "post", post: { publish_date: publish_date(path) }, id: extract_id(path) for path, out in pairs posts "docs" + -- replace yaml headers with moonscript headers 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" - -- is_a: "post" - -- post: { - -- publish_date: publish_date "docs/2023-11-15-test-mix-task-file-modify.md" - -- } - -- id: extract_id "docs/2023-11-15-test-mix-task-file-modify.md" copy "app.css" - - -- filter "test", (body) => - -- require("moon").p body - - -- filter "2023%-08%-03", (body) => - -- print "hello" - -- table.concat { body, "

hey there

" } - -- - -- body\gsub "

.-

", (header) -> - -- table.concat { body, "yoyoasdf" } - -- - -- body\gsub "{.-}", (header) -> - -- require("moon").p header - -- table.concat { '', header, '
' } diff --git a/templates/blog.html b/templates/blog.html index 3657a1a..5bfb1ef 100644 --- a/templates/blog.html +++ b/templates/blog.html @@ -10,17 +10,4 @@ $wrap{"root"}

-
-
-
-

$(title or id)

- -
-
- - $body - - -
+$body diff --git a/templates/post.html b/templates/post.html new file mode 100644 index 0000000..b1e7660 --- /dev/null +++ b/templates/post.html @@ -0,0 +1,16 @@ +$wrap{"blog"} + +
+
+
+

$(title or id)

+ +
+
+ + $body + + +