swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit 7ddb1ccb3ee6e0e2aced1a0c95651a2f1b219ac5
parent 1593675967bded6a056cb7edae7e86a67e230828
Author: uriel@engel.se.cat-v.org <unknown>
Date:   Sat, 18 Oct 2008 03:36:22 +0200

Replace debug_handler with a template.
Diffstat:
Mbin/controller.rc | 16+++++-----------
Alib/_debug.tpl | 6++++++
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/bin/controller.rc b/bin/controller.rc @@ -89,7 +89,6 @@ fn gen_blog_post_title { - # Handlers fn set_handler { handler = $1 @@ -123,19 +122,16 @@ fn dir_listing_handler { 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 { @@ -156,8 +152,6 @@ fn select_handler { '^$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 diff --git a/lib/_debug.tpl b/lib/_debug.tpl @@ -0,0 +1,6 @@ +<pre> +% env | escape_html +--------------------- +% umask +</pre> +