index -- Have to use identifiers as keys instead of the feed objects. Why? Lua tables hash on object -- identity, but our code generates a new Lua object every time a Core object is accessed. gIndexOfFeed = {} for i,feed in feeds do gIndexOfFeed[feed:getIdentifier()] = i-1 end local entryCount = 0 local unreadCount = 0 local previousEntry = nil for i,entry in aggregate:getEntries() do -- nextEntryUnread is named from the view point of previousEntry nextEntryUnread = entry:getRenderUnread() entryCount = entryCount+1 if nextEntryUnread then unreadCount = unreadCount+1 end -- emit template for previous entry - we lag behind by one entry in order to show separators correctly if previousEntry then emit(applyTemplate("entry", previousEntry)) end previousEntry = entry end nextEntryUnread = true -- Never show separator for last entry if previousEntry then emit(applyTemplate("entry", previousEntry)) end ?>