diff -r 74deddff1202 -r 80eb1f7784c4 build.lua --- a/build.lua Mon May 18 15:20:52 2009 +0100 +++ b/build.lua Wed May 20 14:40:24 2009 +0100 @@ -8,6 +8,7 @@ posts_dir = posts_dir or "_posts/" layouts_dir = layouts_dir or "_layouts/" +output_dir = output_dir or "./" -- - -- - -- -- Logging -- @@ -18,6 +19,9 @@ -- Append '/' to end of posts_dir if necessary posts_dir = posts_dir:gsub("([^/])$", "%1/") +-- Append '/' to end of output_dir if necessary +output_dir = output_dir:gsub("([^/])$", "%1/") + -- Append '/' to end of base_url if necessary base_url = base_url:gsub("([^/])$", "%1/") @@ -116,8 +120,8 @@ local unpublished = 0; for n, post in ipairs(posts) do if post.content and (not post.layout or layouts[post.layout]) then - lfs.mkdir(post.shorttitle); - local outfile, err = io.open(post.shorttitle.."/index.html", "w+"); + lfs.mkdir(output_dir..post.shorttitle); + local outfile, err = io.open(output_dir..post.shorttitle.."/index.html", "w+"); if outfile then local layout = layouts[post.layout or "default"]; @@ -163,7 +167,7 @@ msg_info(" - - - "); -- Do feed -local atom = io.open("feed/atom.xml.new", "w+"); +local atom = io.open(output_dir.."feed/atom.xml.new", "w+"); atom:write[[ ]]