swerc

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

commit 6b440b7f45e19563b07a4f29e22dc04d62dc855d
parent 07e406a370630d7caffd7da7ba18f46831fda348
Author: anselm@garbe.us <unknown>
Date:   Sun, 12 Feb 2012 18:39:37 +0100

simplify master template handling
Diffstat:
Mbin/werc.rc | 5+----
Dtpl/headers.tpl | 14--------------
Mtpl/master.tpl | 17+++++++++++++++++
3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/bin/werc.rc b/bin/werc.rc @@ -15,8 +15,6 @@ dirclean=' s/\.(md|1)$//; ' # Careful, the proper p9p path might not be set until initrc.local is sourced path=(. $PLAN9/bin ./bin /bin /usr/bin) -headers=tpl/headers.tpl -res_tail='</body></html>' http_content_type='text/html' ll_add handlers_bar_left nav_tree werc_root=`{pwd} @@ -119,8 +117,7 @@ fn werc_exec_request { if(~ $REQUEST_METHOD HEAD) exit - template $headers $master_template | awk_buffer - echo $res_tail + template $master_template | awk_buffer } werc_exec_request # >[2]/tmp/wercdebug.log diff --git a/tpl/headers.tpl b/tpl/headers.tpl @@ -1,14 +0,0 @@ -<!doctype html> -<html> -<head> - <title>%($pageTitle%)</title> -% env > /tmp/x.txt -% style = `{get_cookie style} -% if(~ $"style 1) { - <link rel="stylesheet" type="text/css" href="/pub/style1.css"> -% } -% if not { - <link rel="stylesheet" type="text/css" href="/pub/style.css"> -% } - <meta charset="utf-8"> -</head> diff --git a/tpl/master.tpl b/tpl/master.tpl @@ -1,3 +1,18 @@ +<!doctype html> +<html> +<head> + <title>%($pageTitle%)</title> +% env > /tmp/x.txt +% style = `{get_cookie style} +% if(~ $"style 1) { + <link rel="stylesheet" type="text/css" href="/pub/style1.css"> +% } +% if not { + <link rel="stylesheet" type="text/css" href="/pub/style.css"> +% } + <meta charset="utf-8"> +</head> +<body> <div id="menu"> <a href="http://suckless.org">home</a> | <a href="http://hg.suckless.org">code</a> | @@ -51,3 +66,5 @@ &copy; 2006-2012 suckless.org community </div> </div> +</body> +</html>