- Move some of the rss code to where it belongs

- Generate </body></html> automatically
This commit is contained in:
uriel 2008-06-09 07:21:39 +02:00
parent a9036d180d
commit 890542d9b9

View File

@ -175,7 +175,34 @@ if(! ~ $#blogDirs 0) {
' '
} }
fn template {
template.awk | rc $rcargs |
awk '{
buf = buf $0"\n"
if(length(buf) > 8192) {
printf "%s", buf
buf = ""
}
}
END{ printf "%s", buf }'
}
if(! ~ $REQUEST_URI */index.rss) {
cat $headers $template | template
echo '</body></html>'
exit
}
# RSS # RSS
if ( ~ $body */[bB]log/indexrss */[bB]log//indexrss && ~ $#blogDirs 0 )
blogDirs = `{basename -d $body}
uri = `{echo $uri | sed 's/indexrss$//'}
uri=$baseuri$"uri
fn statpost { fn statpost {
f = $1 f = $1
uri = `{echo $f | sed 's,^'$sitedir',,'} uri = `{echo $f | sed 's,^'$sitedir',,'}
@ -196,30 +223,6 @@ fn statpost {
} }
} }
fn template {
template.awk | rc $rcargs |
awk '{
buf = buf $0"\n"
if(length(buf) > 8192) {
printf "%s", buf
buf = ""
}
}
END{ printf "%s", buf }'
}
if(! ~ $REQUEST_URI */index.rss) {
cat $headers $template | template
exit
}
if ( ~ $body */[bB]log/indexrss */[bB]log//indexrss && ~ $#blogDirs 0 )
blogDirs = `{basename -d $body}
uri = `{echo $uri | sed 's/indexrss$//'}
uri=$baseuri$"uri
# Should be in a separate file. # Should be in a separate file.
cat <<'!' | template cat <<'!' | template
Content-Type: text/xml; charset=utf-8 Content-Type: text/xml; charset=utf-8