Return a list comprehension

This commit is contained in:
Catalin Constantin Mititiuc 2025-05-23 13:47:59 -07:00
parent ff962d1525
commit 72b771a0cb

View File

@ -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 {
[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) =>