Update atom and rss templates to work with new blagh format.
This commit is contained in:
parent
b425257491
commit
80b80bfc8d
@ -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 -->
|
<!-- TODO: See for more info:http://www.tbray.org/ongoing/When/200x/2005/07/27/Atomic-RSS -->
|
||||||
%{
|
%{
|
||||||
dprint XXX
|
|
||||||
fn statpost {
|
fn statpost {
|
||||||
f = $1
|
f = $1
|
||||||
|
|
||||||
updated = `{/bin/date --rfc-3339'=seconds' -r $f |tr ' ' 'T'}
|
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'}}
|
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]$//'}}
|
# 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)
|
# TODO: use mtime(1) and ls(1) instead of lunix's stat(1)
|
||||||
stat=`{stat -c '%Y %U' $f}
|
stat=`{stat -c '%Y %U' $f}
|
||||||
|
@ -5,9 +5,10 @@ Content-Type: text/xml; charset=utf-8
|
|||||||
%{
|
%{
|
||||||
fn statpost {
|
fn statpost {
|
||||||
f = $1
|
f = $1
|
||||||
|
|
||||||
post_uri = `{echo $f | sed 's,^'$sitedir',,'}
|
post_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]$//'}}
|
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)
|
# TODO: use mtime(1) and ls(1) instead of lunix's stat(1)
|
||||||
stat=`{stat -c '%Y %U' $f}
|
stat=`{stat -c '%Y %U' $f}
|
||||||
#mdate=`{/bin/date -Rd $stat(1)} # Not used because it is unreliable
|
#mdate=`{/bin/date -Rd $stat(1)} # Not used because it is unreliable
|
||||||
@ -21,7 +22,7 @@ fn statpost {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
print
|
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>
|
<generator>Tom Duff's rc, and Kris Maglione's clever hackery</generator>
|
||||||
%{
|
%{
|
||||||
# <webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
|
# <webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
|
||||||
for(f in `{sortedBlogPostList $blogDirs}) {
|
for(f in `{get_post_list $blagh_root$blaghDirs}) {
|
||||||
statpost $f
|
statpost $f
|
||||||
# Hack to aproximate the last build date
|
# Hack to aproximate the last build date
|
||||||
#(use the mdate from last posted item)
|
#(use the mdate from last posted item)
|
||||||
|
Loading…
Reference in New Issue
Block a user