swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit a6d3fb6efa5519ca7dac4a954da83c1eb89f8c61
parent a386437604455a930c9c549a47528b2c48e2697d
Author: uriel@engel.se.cat-v.org <unknown>
Date:   Tue, 13 Jan 2009 03:20:30 +0100

Update atom and rss templates to work with new blagh format.
Diffstat:
Mlib/_apps/blagh/atom.tpl | 3+--
Mlib/_apps/blagh/rss20.tpl | 7++++---
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/_apps/blagh/atom.tpl b/lib/_apps/blagh/atom.tpl @@ -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} diff --git a/lib/_apps/blagh/rss20.tpl b/lib/_apps/blagh/rss20.tpl @@ -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)