changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: Update atom and rss templates to work with new blagh format.

changeset 319: 1778dca75833
parent 318: dcc289b14b9f
child 320: 1c392f7c696d
author: uriel@engel.se.cat-v.org
date: Tue, 13 Jan 2009 03:20:30 +0100
files: lib/_apps/blagh/atom.tpl lib/_apps/blagh/rss20.tpl
description: Update atom and rss templates to work with new blagh format.
     1.1--- a/lib/_apps/blagh/atom.tpl	Tue Jan 13 03:19:45 2009 +0100
     1.2+++ b/lib/_apps/blagh/atom.tpl	Tue Jan 13 03:20:30 2009 +0100
     1.3@@ -4,13 +4,12 @@
     1.4 
     1.5 <!-- TODO: See for more info:http://www.tbray.org/ongoing/When/200x/2005/07/27/Atomic-RSS  -->
     1.6 %{
     1.7-dprint XXX
     1.8 fn statpost {
     1.9     f = $1
    1.10 
    1.11     updated = `{/bin/date --rfc-3339'=seconds' -r $f |tr ' ' 'T'} 
    1.12     post_uri=$base_url^`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!' -e 's/\.(md|tpl)$//g'}}
    1.13-    title=`{read $f}
    1.14+    title=`{read $f/index.md}
    1.15     # Not used: date=`{/bin/date -Rd `{basename $f |sed 's/(^[0-9\-]*).*/\1/; s/-[0-9]$//'}}
    1.16     # TODO: use mtime(1) and ls(1) instead of lunix's stat(1)
    1.17     stat=`{stat -c '%Y %U' $f}
     2.1--- a/lib/_apps/blagh/rss20.tpl	Tue Jan 13 03:19:45 2009 +0100
     2.2+++ b/lib/_apps/blagh/rss20.tpl	Tue Jan 13 03:20:30 2009 +0100
     2.3@@ -5,9 +5,10 @@
     2.4 %{
     2.5 fn statpost {
     2.6 	f = $1
     2.7+
     2.8 	post_uri = `{echo $f | sed 's,^'$sitedir',,'}
     2.9 	title=`{basename $f | sed 's/^[0-9\-]*_(.*)\.md$/\1/; s/_/ /g' }
    2.10-	date=`{/bin/date -Rd `{basename $f |sed 's/(^[0-9\-]*).*/\1/; s/-[0-9]$//'}}
    2.11+	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,'}}
    2.12 	# TODO: use mtime(1) and ls(1) instead of lunix's stat(1)
    2.13 	stat=`{stat -c '%Y %U' $f}
    2.14 	#mdate=`{/bin/date -Rd $stat(1)} # Not used because it is unreliable
    2.15@@ -21,7 +22,7 @@
    2.16 				exit
    2.17 			}
    2.18 			print
    2.19-		}' $f |fmt -j| sed 's/\]\]>/Fucking goddamn XML garbage/g'}
    2.20+		}' $f/index.md |fmt -j| sed 's/\]\]>/Fucking goddamn XML garbage/g'}
    2.21 	}
    2.22 }
    2.23 
    2.24@@ -37,7 +38,7 @@
    2.25 		<generator>Tom Duff's rc, and Kris Maglione's clever hackery</generator>
    2.26 %{
    2.27 		# <webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
    2.28-		for(f in `{sortedBlogPostList $blogDirs}) {
    2.29+        for(f in `{get_post_list $blagh_root$blaghDirs}) {
    2.30 			statpost $f
    2.31 			# Hack to aproximate the last build date 
    2.32 			#(use the mdate from last posted item)