diff --git a/site.moon b/site.moon index 7fcb657..bd2b0d7 100644 --- a/site.moon +++ b/site.moon @@ -104,6 +104,11 @@ documents = (path=".") -> files = reverse get_files path {join(path, file), target(file, "/posts") for file in *files} +clean = (target) -> + dirty = extract_date target + escaped = dirty\gsub("%-", "%%-") .. "%-" + target\gsub(escaped, "") + sitegen.create => @site_title = "WebDevCat.me" @app_name = "stasis" @@ -114,16 +119,8 @@ sitegen.create => for path, target in pairs files id = extract_id path - d = extract_date target - d = d\gsub("%-", "%%-") .. "%-" - p d - e = target\gsub(d, "") - p e - -- p target\gsub(extract_date(target), "") - add path, - target: e - -- target: target\gsub, "/%d%d%[.][%w%-]+$", id -- TODO reformat target + target: clean(target) template: name is_a: name publish_date: publish_date path