diff -r cebf96c3b522 -r 951de9625338 build.lua --- a/build.lua Sat May 23 20:18:49 2009 +0100 +++ b/build.lua Sat May 23 21:15:19 2009 +0100 @@ -117,7 +117,7 @@ msg_info(" - - - "); -local unpublished = 0; +local unpublished, removed_posts = 0, {}; for n, post in ipairs(posts) do if post.content and (not post.layout or layouts[post.layout]) then lfs.mkdir(output_dir..post.shorttitle); @@ -144,7 +144,7 @@ -- Not published yet, hide it --msg_info("Hiding unpublished post"); unpublished = unpublished + 1; - posts[n] = nil; + table.insert(removed_posts, n); end else msg_error("Failed to write HTML: %s", err); @@ -157,6 +157,12 @@ end end +local removed = 0; +for _, n in ipairs(removed_posts) do + table.remove(posts, n-removed); + removed = removed + 1; +end + -- Do main page local main_tpl = templates.init(layouts_dir.."/main.html");