simplify master template handling - swerc - anselm's simpler werc fork
 (HTM) git clone git://git.suckless.org/swerc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit 6b440b7f45e19563b07a4f29e22dc04d62dc855d
 (DIR) parent 07e406a370630d7caffd7da7ba18f46831fda348
 (HTM) Author: anselm@garbe.us <unknown>
       Date:   Sun, 12 Feb 2012 18:39:37 +0100
       
       simplify master template handling
       Diffstat:
         M bin/werc.rc                         |       5 +----
         D tpl/headers.tpl                     |      14 --------------
         M tpl/master.tpl                      |      17 +++++++++++++++++
       
       3 files changed, 18 insertions(+), 18 deletions(-)
       ---
 (DIR) 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
 (DIR) 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> 
 (DIR) 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>