Update atom and rss templates to work with new blagh format.

This commit is contained in:
uriel 2009-01-13 03:20:30 +01:00
parent b425257491
commit 80b80bfc8d
2 changed files with 5 additions and 5 deletions

View File

@ -4,13 +4,12 @@ Content-Type: application/atom+xml
<!-- TODO: See for more info:http://www.tbray.org/ongoing/When/200x/2005/07/27/Atomic-RSS -->
%{
dprint XXX
fn statpost {
f = $1
updated = `{/bin/date --rfc-3339'=seconds' -r $f |tr ' ' 'T'}
post_uri=$base_url^`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!' -e 's/\.(md|tpl)$//g'}}
title=`{read $f}
title=`{read $f/index.md}
# Not used: date=`{/bin/date -Rd `{basename $f |sed 's/(^[0-9\-]*).*/\1/; s/-[0-9]$//'}}
# TODO: use mtime(1) and ls(1) instead of lunix's stat(1)
stat=`{stat -c '%Y %U' $f}

View File

@ -5,9 +5,10 @@ Content-Type: text/xml; charset=utf-8
%{
fn statpost {
f = $1
post_uri = `{echo $f | sed 's,^'$sitedir',,'}
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]$//'}}
date=`{/bin/date -Rd `{echo $f|sed 's,.*/([0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9])/.*,\1,'}}
# TODO: use mtime(1) and ls(1) instead of lunix's stat(1)
stat=`{stat -c '%Y %U' $f}
#mdate=`{/bin/date -Rd $stat(1)} # Not used because it is unreliable
@ -21,7 +22,7 @@ fn statpost {
exit
}
print
}' $f |fmt -j| sed 's/\]\]>/Fucking goddamn XML garbage/g'}
}' $f/index.md |fmt -j| sed 's/\]\]>/Fucking goddamn XML garbage/g'}
}
}
@ -37,7 +38,7 @@ fn statpost {
<generator>Tom Duff's rc, and Kris Maglione's clever hackery</generator>
%{
# <webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
for(f in `{sortedBlogPostList $blogDirs}) {
for(f in `{get_post_list $blagh_root$blaghDirs}) {
statpost $f
# Hack to aproximate the last build date
#(use the mdate from last posted item)