shithub: werc

Download patch

ref: f40f6fe77f6d01c9dfbeef69c7b8eb230a7aa2d5
parent: 0062b0b98b2b3d8d1153d5aa282260f5af9c2add
author: uriel <uriel@suckless.org>
date: Sat Jul 12 03:58:04 EDT 2008

Rss compliance fix, put lastBuildDate where it belongs, even if the value is just aproximated

--- a/pub/feeds/rss20.tpl
+++ b/pub/feeds/rss20.tpl
@@ -13,15 +13,21 @@
 %{
 		for(f in `{sortedBlogPostList $blogDirs}) {
 			statpost $f
-%}		<item>
+			# Hack to aproximate the last build date (use the mdate from last posted item)
+			if(~ $#last_build_date 0) {
+				last_build_date='<lastBuildDate>'^$"mdate'</lastBuildDate>'
+				echo $last_build_date
+			}
+%}
+		<item>
 			<title>%($title%)</title>
 			<author>%($by%)@noreply.cat-v.org (%($by%))</author>
 			<link>%($uri%)</link>
                         <guid isPermaLink="true">%($uri%)</guid>
 			<pubDate>%($date%)</pubDate>
-			<lastBuildDate>%($mdate%)</lastBuildDate>
 			<description><![CDATA[<pre>%($summary%)</pre>]]></description>
 		</item>
 %		}
+
 	</channel>
 </rss>