shithub: werc

Download patch

ref: 53ae163a1ae0f476e25dc6b8877f411682ea5d01
parent: 9ec876cf2a0d0006f80c062d3d7a5658b69aa18d
author: kris <[email protected]>
date: Mon Jun 4 16:41:42 EDT 2007

Wrap the RSS description in <pre> tags. Fix summary. (should run the description through fmt(1), since *some* people insist on using WordPress, which doesn't hard wrap paragraphs).

--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -25,7 +25,7 @@
     echo '<h1 class="headerTitle"><a href="/">' ^ $"siteTitle ^ '<span id="headerSubTitle">' ^ $"siteSubTitle ^ '</span></a></h1>'
 }
 
-dirfilter = '/\/\./d; /\/_[^\/]*$/d; s,^\./,,; s,\.md$,,;'
+dirfilter = '/\/[._]/d; s,^\./,,; s,\.md$,,;'
 
 # Sidebar 
 fn menu {
@@ -130,7 +130,7 @@
 	title=`{basename $f | sed 's/^[0-9\-]*_(.*)\.md$/\1/; s/_/ /g' }
 	stat=`{stat -c '%Y %U' $f}
 	date=`{/bin/date -Rd @$stat(1)}
-	uri=$baseuri^`{cleanname $uri}
+	uri=$baseuri^`{cleanname `{echo -n $uri | sed 's/\.(md|tpl)//g'}}
 	by=$stat(2)
 	ifs=() {
 		summary=`{awk -v max'='1024 '{
@@ -186,7 +186,7 @@
 			<link>%($uri%)</link>
                         <guid isPermaLink="true">%($uri%)</guid>
 			<pubDate>%($date%)</pubDate>
-			<description><![CDATA[%($summary%)]]></description>
+			<description><![CDATA[<pre>%($summary%)</pre>]]></description>
 		</item>
 %		}
 	</channel>