shithub: werc

Download patch

ref: 769f1b52d47899c096a38c61a0e2ff971dd74999
parent: 53ae163a1ae0f476e25dc6b8877f411682ea5d01
author: kris <[email protected]>
date: Mon Jun 4 16:57:18 EDT 2007

Create $extraHeaders for pages with blog entries.

--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -12,13 +12,12 @@
 sitedir=sites/$site
 headers=inc/headers.tpl
 body=index
-siteTitle=''
-siteSubTitle=''
-title=''
 template=_default
 sidebar=sidebar
 basedir=/gsoc/www
 baseuri=http://$site
+for(i in siteTitle siteSubTitle title extraHeaders)
+    $i = ''
 
 # Title
 fn gentitle {
@@ -117,11 +116,24 @@
 }
 
 template=$sitedir/$template.tpl
-body=$sitedir/$body
 if (! ~ $#sidebar 0)
     sidebar=tpl/_inc/$sidebar.tpl
-if (test -d $body)
+
+body=$sitedir/$body
+rssuri=$uri
+if (test -d $body) {
     body=$body/index
+    rssuri=$rssuri/
+}
+rssuri=`{cleanname `{basename -d $uri}^/index.rss}
+rssuri=$baseuri$rssuri
+
+if(! ~ $#blogDirs 0)
+    extraHeaders=$"extraHeaders ^ \
+    	'<link rel="alternate" type="application/rss+xml" title="RSS" href="'$rssuri'">
+'
+
+echo hesd: $extraHeaders
 
 # RSS
 fn statpost {