This commit is contained in:
Catalin Constantin Mititiuc 2025-06-16 20:18:05 -07:00
parent 1f7deb58be
commit 83dc0e1990
3 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,10 @@
<h2>Posts</h2>
$list_posts
$(get_posts())[[
<section>
<h3><a href="$target">$post_title</a></h3>
<time>$publish_date</time> — $blurb
<a class="read-post-link" href="$target">Read post →</a>
</section>
]]

View File

@ -6,9 +6,6 @@ $render{"templates/wares"}
<h2>Posts</h2>
$({{go = "yeah"}})[[<p>$go! I can't believe this thing works!</p>]]
$(blah)[[$say, ]]
$blah[[<p>$say</p>]]
$(get_posts({limit = 5}))[[
<section>
<h3><a href="$target">$post_title</a></h3>

View File

@ -97,7 +97,8 @@ list_posts = (page, args={}) ->
get_posts = (args={}) =>
posts = @site\query_pages { is_a: "post" }
table.sort posts, (a, b) -> a.source > b.source
for { meta: meta, source: source } in *posts[1, args.limit or #posts]
return for { meta: meta, source: source } in *posts[1, args.limit or #posts]
{
target: meta.target
post_title: meta.title or titleize_slug meta.id
@ -126,6 +127,10 @@ get_some = (args={}) =>
blurb: post.meta.blurb
} for post in *posts[1, args.limit or #posts]]
get_something = (args={}, a) =>
p a
{limit: "ok"}
sitegen.create =>
@site_title = "WebDevCat.me"
@app_name = "stasis"
@ -133,6 +138,7 @@ sitegen.create =>
@list_posts = list_posts
@get_posts = get_posts
@get_some = get_some
@get_something = get_something
add "index.html", title: "Catalin Mititiuc", blah: {{say: "wan"},{say: "tuu"}}
add "blog.html", title: "Posts", target: "posts/index", template: "blog"