From 21a4d933baec163113724b546c12033fe047c3ec Mon Sep 17 00:00:00 2001 From: Catalin Constantin Mititiuc Date: Mon, 16 Jun 2025 20:18:05 -0700 Subject: [PATCH] WIP --- index.html | 5 +++++ site.moon | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index cde2100..c5c9559 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,11 @@ $render{"templates/wares"}

Posts

+$({{hi = "there"}})[[$hi]] + +$(test1({limit = 2}))[[

inline template $title

]] +$each{test2({limit = 2}), "post"}[[$post]] + $(list_posts1({limit = 2}))[[

$title

]] $each{list_posts2({limit = 2}), "post"}[[$post]] diff --git a/site.moon b/site.moon index 5e8ffad..7bf1dee 100644 --- a/site.moon +++ b/site.moon @@ -120,10 +120,9 @@ get_posts = (args={}) => url: rootname page\url_for! } -test = (arg) => - (a, b, c) => - p arg - "hi" +test = (args={}, template) => + vals = { title: "yoayasdf" } + if template then common.fill_ignoring_pre template, vals else { vals } -- replace '$if' helper function with cosmo's 'cif' html_renderer.cosmo_helpers.if = (args, has_block) => cosmo.cif args, has_block @@ -134,6 +133,9 @@ documents = (path=".") -> files = reverse get_files path {join(path, file), target(file, "/posts") for file in *files} +test3 = (args, template) => + p two + sitegen.create => @site_title = "WebDevCat.me" @app_name = "stasis" @@ -142,8 +144,9 @@ sitegen.create => @list_posts1 = list_posts @ @list_posts2 = list_posts @, template @get_posts = get_posts - -- @list_posts1 = list_posts @, [[$title]] - -- @list_posts2 = list_posts @ + @test1 = (args) => test @, args + @test2 = (args) => test @, args, [[passed template $title]] + @test3 = test3 add_all = (name="", files) -> for path, target in pairs files