shithub: werc

Download patch

ref: 72475062ce1be783224645cfb4f8a3e1cd62a900
parent: 00991322acf5d66250a0db1fa578fa301c021b40
author: uriel <uriel@engel.se.cat-v.org>
date: Fri Oct 17 23:36:22 EDT 2008

Replace debug_handler with a template.

--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -89,7 +89,6 @@
 
 
 
-
 # Handlers
 fn set_handler {
     handler = $1
@@ -123,20 +122,17 @@
 
 fn 404_handler { template `{ get_lib_file 404.tpl } }
 
+fn blog_dir_handler {
+    blogDirs = $*
+    tpl_handler lib/feeds/html.tpl
+}
+
 fn blog_post_handler {
     gen_blog_post_title $1 | $formatter
     $formatter < $1
 }
 
-fn debug_handler {
-    echo '<pre>'
-    env | escape_html
-    echo ---------------------
-    umask
-    echo '</pre>'
-}
 
-
 fn select_handler {
 
     if (test -f $body.md) {
@@ -156,8 +152,6 @@
 '^$comment_text } > $ddir/$d.rec
         }
     }
-    if not if (~ $body */_debug)
-        set_handler debug_handler 
     if not if (test -f $body.tpl)
         set_handler tpl_handler $body.tpl
 
--- /dev/null
+++ b/lib/_debug.tpl
@@ -1,0 +1,6 @@
+<pre>
+% env | escape_html
+---------------------
+% umask
+</pre>
+