env = {} date_input_formats = soupault_config["index"]["date_formats"] local count = size(site_index) local n = 1 local m = 1 local entries = {} while (n <= count) do local entry = site_index[n] if Table.has_key(entry, "tags") then if not Table.has_value(entry["tags"], "draft") then -- Wed, 02 Oct 2002 13:00:00 GMT entry["date_rfc822"] = Date.reformat(entry["date"], date_input_formats, "%a, %d %b %y %T %z") --"%Y-%m-%dT%H:%M:%S%:z") entries[m] = entry m = m + 1 end end n = n + 1 end env['contents'] = entries template = Sys.read_file(config['index_rss_template_file']) path = Sys.join_path(target_dir, 'index.xml') Sys.write_file(path, String.render_template(template, env))