WIP
This commit is contained in:
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,
|
||||
|
||||
Reference in New Issue
Block a user