build.lua

changeset 16
f5afa9d3d3c5
parent 12
4c759312950b
equal deleted inserted replaced
15:e784e417a3e2 16:f5afa9d3d3c5
164 atom:write("\t<link href='", base_url, "feed/atom.xml' rel='self' />\n"); 164 atom:write("\t<link href='", base_url, "feed/atom.xml' rel='self' />\n");
165 atom:write("\t<link href='", base_url, "' />\n"); 165 atom:write("\t<link href='", base_url, "' />\n");
166 166
167 atom:write("\t<updated>", os.date "!%Y-%m-%dT%H:%M:%SZ", "</updated>\n"); 167 atom:write("\t<updated>", os.date "!%Y-%m-%dT%H:%M:%SZ", "</updated>\n");
168 168
169 for n, post in ipairs(posts) do 169 for n = #posts,#posts-10,-1 do
170 if n > 10 then break; end 170 local post = posts[n];
171 if post.published then 171 if post.published then
172 atom:write("<entry>\n"); 172 atom:write("<entry>\n");
173 atom:write("\t<author>\n\t\t<name>", post.author or default_author or "Unknown Author", "</name>\n\t</author>\n"); 173 atom:write("\t<author>\n\t\t<name>", post.author or default_author or "Unknown Author", "</name>\n\t</author>\n");
174 atom:write("\t<id>", post.url, "</id>\n"); 174 atom:write("\t<id>", post.url, "</id>\n");
175 atom:write("\t<title>", post.title, "</title>\n"); 175 atom:write("\t<title>", post.title, "</title>\n");

mercurial