Refactor the 'for' loop that adds all the post files
This commit is contained in:
10
site.moon
10
site.moon
@@ -62,9 +62,13 @@ sitegen.create =>
|
||||
add "index.html"
|
||||
add "blog.html", target: "posts/index", template: "blog"
|
||||
|
||||
add path, target: out, template: "post", is_a: "post", post: {
|
||||
publish_date: publish_date(path)
|
||||
}, id: extract_id(path) for path, out in pairs posts "docs"
|
||||
for path, target in pairs posts "docs"
|
||||
add path,
|
||||
target: target
|
||||
template: "post"
|
||||
is_a: "post"
|
||||
publish_date: publish_date(path)
|
||||
id: extract_id(path)
|
||||
|
||||
-- replace post markdown yaml headers with moonscript headers
|
||||
filter "docs", (body) =>
|
||||
|
||||
Reference in New Issue
Block a user