shithub: werc

Download patch

ref: fed0fb025a66ac2bc91123a22637d757fe610ac9
parent: 28bb70308b007946e5c900a6b1a56034b5b3e35f
author: Stanley Lieber <sl@stanleylieber.com>
date: Fri Jan 29 16:46:41 EST 2021

apps/blagh/rss20.tpl: print correct <pubDate> for each <item> (thanks, phil9)

--- a/apps/blagh/rss20.tpl
+++ b/apps/blagh/rss20.tpl
@@ -25,10 +25,10 @@
 	# rfc2822 last time channel content changed.
 	lbd=`{ndate -m `{date `{mtime `{ls $blagh_root$blagh_dirs/[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/[0-9] | tail -1} | awk '{print $1}'}}}
 	echo '<lastBuildDate>'$"lbd'</lastBuildDate>'
-	# rfc2822 publication date for content in the channel.
-	pubdate=`{ndate -m}
         for(f in `{get_post_list $blagh_root$blagh_dirs}){
             statpost $f
+	    # rfc2822 publication date for this post.
+	    pubdate=`{ndate -m `{date `{mtime $f | awk '{print $1}'}}}
 %}
         <item>
             <title><![CDATA[%($title%)]]></title>
--