From 72b771a0cb7fbdc5fe29374b4eac2725e9822f16 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Fri, 23 May 2025 13:47:59 -0700 Subject: [PATCH] Return a list comprehension --- site.moon | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/site.moon b/site.moon index 254e912..eab45d6 100644 --- a/site.moon +++ b/site.moon @@ -91,18 +91,18 @@ sitegen.create => @site_title = "WebDevCat.me" @app_name = "stasis" @version = "0.2.12" + @just_render_the_damn_list = (arg={}, _) => posts = [listing_info post for post in *get_posts @, arg.limit] html.build -> import section, h3, time, a from tag - return for { :title, :url, :blurb, publish_date: { iso, pretty }} in *posts - section { - h3 { a { title, href: url }} - time { pretty, datetime: iso } - "—", blurb, a { "Read post →", class: "read-post-link", href: url } - } + [section { + h3 { a { title, href: url }} + time { pretty, datetime: iso } + "—", blurb, a { "Read post →", class: "read-post-link", href: url } + } for { :title, :url, :blurb, publish_date: { iso, pretty }} in *posts] add_all = (files) -> for path in *files @@ -116,7 +116,6 @@ sitegen.create => add "index.html", title: "Catalin Mititiuc" add "blog.html", title: "Posts", target: "posts/index", template: "blog" add_all files_from "docs" - -- add_all files_from "docs", to: "/posts", as: "post" -- replace post markdown yaml headers with moonscript headers filter "docs", (body) =>