diff --git a/site.moon b/site.moon index 2792127..5d7c5b0 100644 --- a/site.moon +++ b/site.moon @@ -105,7 +105,7 @@ html_renderer.cosmo_helpers.if = (args, has_block) => cosmo.cif args, has_block -- add a '$titleize' helper function html_renderer.cosmo_helpers.titleize = (slug) => titleize_slug slug -documents = (path=".") -> +files_from = (path=".") -> [Path.join path, file for file in *reverse get_files path] sitegen.create => @@ -114,18 +114,18 @@ sitegen.create => @version = "0.2.12" @list_posts = list_posts @, template - add_all = (name, files) -> + add_all = (files) -> for path in *files add path, target: target(path, "/posts") - template: name - is_a: name + template: "post" + is_a: "post" publish_date: publish_date path id: extract_id path add "index.html", title: "Catalin Mititiuc" add "blog.html", title: "Posts", target: "posts/index", template: "blog" - add_all "post", documents "docs" + add_all files_from "docs" -- replace post markdown yaml headers with moonscript headers filter "docs", (body) =>