WIP
This commit is contained in:
parent
6c60c1230e
commit
544bb20c2d
@ -2,6 +2,12 @@
|
||||
date: "Thu May 08 2025 19:41:30.000000000"
|
||||
}
|
||||
|
||||
$one{some_var = "paris"}
|
||||
|
||||
$two{limit = "here"}[[the limit is $limit]]
|
||||
|
||||
<hr />
|
||||
|
||||
$list3{ limit = 2 }[[
|
||||
<section><h3>$title</h3></section>
|
||||
]]
|
||||
|
17
site.moon
17
site.moon
@ -143,6 +143,11 @@ list3 = (args={}, has_block) =>
|
||||
|
||||
return result unless has_block
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- use in templates
|
||||
-- $list2{[[<p>$title</p>]], 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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user