build.lua: Write the latest 10 entries to the feed, not the earliest 10 entries :)

Fri, 04 Dec 2009 01:26:48 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 04 Dec 2009 01:26:48 +0000
changeset 16
f5afa9d3d3c5
parent 15
e784e417a3e2
child 17
1d0ae741807e

build.lua: Write the latest 10 entries to the feed, not the earliest 10 entries :)

build.lua file | annotate | diff | comparison | revisions
--- a/build.lua	Mon Jul 20 23:49:43 2009 +0100
+++ b/build.lua	Fri Dec 04 01:26:48 2009 +0000
@@ -166,8 +166,8 @@
 
 atom:write("\t<updated>", os.date "!%Y-%m-%dT%H:%M:%SZ", "</updated>\n");
 
-for n, post in ipairs(posts) do
-	if n > 10 then break; end
+for n = #posts,#posts-10,-1 do
+	local post = posts[n];
 	if post.published then
 		atom:write("<entry>\n");
 		atom:write("\t<author>\n\t\t<name>", post.author or default_author or "Unknown Author", "</name>\n\t</author>\n");

mercurial