From 5d2d8ba8c9ab0dae8f3db2f04962d65d9c7325d0 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Thu, 22 May 2025 09:51:30 -0700 Subject: [PATCH] Improve documentation according to ldoc --- site.moon | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/site.moon b/site.moon index 5d7c5b0..ac4c25e 100644 --- a/site.moon +++ b/site.moon @@ -74,7 +74,9 @@ template = [[ ]] --- setup in create function: +--- creates a list of post links for rendering in templates. +-- @usage +-- set up in create function: -- -- sitegen.create => -- @list_posts = list_posts @, [template] @@ -83,6 +85,13 @@ template = [[ -- -- `list_posts @` expects $(list_posts({limit = 2}))[[

$title

]] -- `list_posts @, template` expects $each{list_posts({limit = 2}), "post"}[[$post]] +-- +-- @tparam Page @ the calling page. +-- @tparam[opt] string template a string that can contain variables and +-- helpers. +-- +-- @treturn func the function that will be called when this is used in a +-- template. list_posts = (template) => (args={}) => pages = @site\query_pages { is_a: "post" } table.sort pages, (a, b) -> a.source > b.source