More correctly follow the rss spec, and use mtime for lastBuildDate and the post date for pubDate instead.

This commit is contained in:
Uriel 2008-06-11 20:09:41 +02:00
parent 0a93e100d6
commit 62ae03cd3b

View file

@ -207,8 +207,9 @@ fn statpost {
f = $1 f = $1
uri = `{echo $f | sed 's,^'$sitedir',,'} uri = `{echo $f | sed 's,^'$sitedir',,'}
title=`{basename $f | sed 's/^[0-9\-]*_(.*)\.md$/\1/; s/_/ /g' } title=`{basename $f | sed 's/^[0-9\-]*_(.*)\.md$/\1/; s/_/ /g' }
date=`{/bin/date -Rd `{basename $f |sed 's/(^[0-9\-]*).*/\1/; s/-[0-9]$//'}}
stat=`{stat -c '%Y %U' $f} stat=`{stat -c '%Y %U' $f}
date=`{/bin/date -Rd @$stat(1)} mdate=`{/bin/date -Rd @$stat(1)}
uri=$baseuri^`{cleanname `{echo -n $uri | sed 's/\.(md|tpl)//g'}} uri=$baseuri^`{cleanname `{echo -n $uri | sed 's/\.(md|tpl)//g'}}
by=$stat(2) by=$stat(2)
ifs=() { ifs=() {
@ -246,6 +247,7 @@ Content-Type: text/xml; charset=utf-8
<link>%($uri%)</link> <link>%($uri%)</link>
<guid isPermaLink="true">%($uri%)</guid> <guid isPermaLink="true">%($uri%)</guid>
<pubDate>%($date%)</pubDate> <pubDate>%($date%)</pubDate>
<lastBuildDate>%($mdate%)</lastBuildDate>
<description><![CDATA[<pre>%($summary%)</pre>]]></description> <description><![CDATA[<pre>%($summary%)</pre>]]></description>
</item> </item>
% } % }