shithub: werc

Download patch

ref: 9c40f7e145e7c3564e2998126ffdf2bbb3edfb43
parent: 8d4c6a7b6a788b5f623ec4da4060895b74adf199
author: uriel <uriel@suckless.org>
date: Thu Jun 26 23:16:07 EDT 2008

Move rss template into its own file

diff: cannot open b/pub/feeds//null: file does not exist: 'b/pub/feeds//null'
--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -231,33 +231,4 @@
 	}
 }
 
-# Should be in a separate file.
-cat <<'!' | template
-Content-Type: text/xml; charset=utf-8
-
-<?xml version="1.0" encoding="UTF-8"?>
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
-	<channel>
-		<atom:link href="%('http://'$site^$REQUEST_URI%)" rel="self" type="application/rss+xml" />
-		<title>%($siteTitle%)</title>
-		<link>%($uri%)</link>
-		<description>%($blogDesc%)</description>
-		<language>en-us</language>
-		<generator>Tom Duff's rc, and Kris Maglione's clever hackery</generator>
-		<webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
-%{
-		for(f in `{sortedBlogPostList $blogDirs}) {
-			statpost $f
-%}		<item>
-			<title>%($title%)</title>
-			<author>%($by%)@noreply.cat-v.org (%($by%))</author>
-			<link>%($uri%)</link>
-                        <guid isPermaLink="true">%($uri%)</guid>
-			<pubDate>%($date%)</pubDate>
-			<lastBuildDate>%($mdate%)</lastBuildDate>
-			<description><![CDATA[<pre>%($summary%)</pre>]]></description>
-		</item>
-%		}
-	</channel>
-</rss>
-!
+cat pub/feeds/rss20.tpl | template
--- /dev/null
+++ b/pub/feeds/rss20.tpl
@@ -1,0 +1,27 @@
+Content-Type: text/xml; charset=utf-8
+
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+	<channel>
+		<atom:link href="%('http://'$site^$REQUEST_URI%)" rel="self" type="application/rss+xml" />
+		<title>%($siteTitle%)</title>
+		<link>%($uri%)</link>
+		<description>%($blogDesc%)</description>
+		<language>en-us</language>
+		<generator>Tom Duff's rc, and Kris Maglione's clever hackery</generator>
+		<webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
+%{
+		for(f in `{sortedBlogPostList $blogDirs}) {
+			statpost $f
+%}		<item>
+			<title>%($title%)</title>
+			<author>%($by%)@noreply.cat-v.org (%($by%))</author>
+			<link>%($uri%)</link>
+                        <guid isPermaLink="true">%($uri%)</guid>
+			<pubDate>%($date%)</pubDate>
+			<lastBuildDate>%($mdate%)</lastBuildDate>
+			<description><![CDATA[<pre>%($summary%)</pre>]]></description>
+		</item>
+%		}
+	</channel>
+</rss>