Add posts page; fix post templates
This commit is contained in:
35
site.moon
35
site.moon
@@ -43,45 +43,18 @@ sitegen.create =>
|
||||
@app_name = "stasis"
|
||||
@version = "0.2.12"
|
||||
|
||||
-- add "test.md"
|
||||
--
|
||||
-- filter "test", (body) =>
|
||||
-- body\gsub "%-%-%-.-%.%.%.", (yaml_header) ->
|
||||
-- moonscript_header = yaml_header\gsub "%-%-%-", "{"
|
||||
-- result = moonscript_header\gsub "%.%.%.", "}"
|
||||
-- result
|
||||
|
||||
add "index.html"
|
||||
add path, target: out, template: "blog", is_a: "post", post: {
|
||||
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"
|
||||
|
||||
-- replace yaml headers with moonscript headers
|
||||
filter "docs", (body) =>
|
||||
body\gsub "%-%-%-.-%.%.%.", (yaml_header) ->
|
||||
moonscript_header = yaml_header\gsub "%-%-%-", "{"
|
||||
result = moonscript_header\gsub "%.%.%.", "}"
|
||||
result
|
||||
-- add "docs/2023-11-15-test-mix-task-file-modify.md",
|
||||
-- target: "posts/2023-11-15-test-mix-task-file-modify.html"
|
||||
-- template: "blog"
|
||||
-- is_a: "post"
|
||||
-- post: {
|
||||
-- publish_date: publish_date "docs/2023-11-15-test-mix-task-file-modify.md"
|
||||
-- }
|
||||
-- id: extract_id "docs/2023-11-15-test-mix-task-file-modify.md"
|
||||
|
||||
copy "app.css"
|
||||
|
||||
-- filter "test", (body) =>
|
||||
-- require("moon").p body
|
||||
|
||||
-- filter "2023%-08%-03", (body) =>
|
||||
-- print "hello"
|
||||
-- table.concat { body, "<p>hey there</p>" }
|
||||
--
|
||||
-- body\gsub "<h1>.-</h1>", (header) ->
|
||||
-- table.concat { body, "yoyoasdf" }
|
||||
--
|
||||
-- body\gsub "{.-}", (header) ->
|
||||
-- require("moon").p header
|
||||
-- table.concat { '</div>', header, '<div class="main">' }
|
||||
|
||||
Reference in New Issue
Block a user