From 544bb20c2d8877a9b943c088ab293bf7935cee9e Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Thu, 22 May 2025 19:13:02 -0700 Subject: [PATCH] WIP --- index.html | 6 ++++++ site.moon | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/index.html b/index.html index 0157105..2a8ee81 100644 --- a/index.html +++ b/index.html @@ -2,6 +2,12 @@ date: "Thu May 08 2025 19:41:30.000000000" } +$one{some_var = "paris"} + +$two{limit = "here"}[[the limit is $limit]] + +
+ $list3{ limit = 2 }[[

$title

]] diff --git a/site.moon b/site.moon index 8e9ed57..69cfe0c 100644 --- a/site.moon +++ b/site.moon @@ -143,6 +143,11 @@ list3 = (args={}, has_block) => return result unless has_block + + + + + -- use in templates -- $list2{[[

$title

]], limit = 2} -- $each{$list2({limit = 3}), "item"}[[$item]] @@ -165,6 +170,15 @@ list2 = (args={}) => return if args[1] then table.concat result else result +one = (template) => + (arg, _has_block) => + common.fill_ignoring_pre template, arg + +two = (arg, has_block) => + common.throw_error "expecting a block" if not has_block + cosmo.yield arg + nil -- VERY IMPORTANT! + sitegen.create => @site_title = "WebDevCat.me" @app_name = "stasis" @@ -174,6 +188,9 @@ sitegen.create => @list2 = list2 @list3 = list3 + @one = one @, [[inline template $some_var]] + @two = two + add_all = (files) -> for path in *files add path,