removed get_cookie and dark style, stick to default style only, no choice - swerc - anselm's simpler werc fork
 (HTM) git clone git://git.suckless.org/swerc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit c90ef78b4a5d00b7821bb6f5200d3e26763fd4e7
 (DIR) parent 3dff3af94699d246597420d575500e820d20256d
 (HTM) Author: anselm@garbe.us <unknown>
       Date:   Mon, 13 Feb 2012 19:55:06 +0100
       
       removed get_cookie and dark style, stick to default style only, no choice
       Diffstat:
         M bin/util.rc                         |      16 ++++------------
         M bin/werc.rc                         |       4 ++--
         D pub/style1.css                      |     156 -------------------------------
         M tpl/master.tpl                      |       7 -------
       
       4 files changed, 6 insertions(+), 177 deletions(-)
       ---
 (DIR) diff --git a/bin/util.rc b/bin/util.rc
       @@ -30,17 +30,6 @@ fn awk_buffer {
            END { printf "%s", buf }'
        }
        
       -##############################################################################
       -# Cookies
       -fn get_cookie {
       -    ifs=';' { co=`{echo $HTTP_COOKIE} }
       -
       -    # XXX: we might be adding a trailing new line?
       -    # The ' ?' is needed to deal with '; ' inter-cookie delimiter
       -    { for(c in $co) echo $c } | sed -n 's/^ ?'$1'=//p' 
       -}
       -
       -
        fn static_file {
            echo 'Content-Type: '`{select_mime $1}
            echo
       @@ -93,8 +82,11 @@ fn conf_perm_redirect {
            if not
                ll_addh perm_redir_patterns $1 $2
        }
       +
        fn get_tpl_file {
       -    if(test -f tpl/$1)
       +    if(test -f tpl/$1.local)
       +        echo -n tpl/$1.local
       +    if not if(test -f tpl/$1)
                echo -n tpl/$1
            if not
                status='Can''t find tpl file: '$1
 (DIR) diff --git a/bin/werc.rc b/bin/werc.rc
       @@ -20,10 +20,10 @@ ll_add handlers_bar_left nav_tree
        werc_root=`{pwd}
        sitesdir=sites
        
       - . ./etc/initrc
       -
        if(test -f etc/initrc.local)
            . ./etc/initrc.local
       +if not
       +    . ./etc/initrc
        
        fn werc_exec_request {
            site=$SERVER_NAME
 (DIR) diff --git a/pub/style1.css b/pub/style1.css
       @@ -1,156 +0,0 @@
       -body {
       -        background-color: #333;
       -        color: #ddd;
       -        font-family: Helvetica, Verdana, Arial, 'Liberation Sans', FreeSans, sans-serif;
       -        padding: 0;
       -        margin: 0;
       -}
       -
       -a {
       -        color: #6af;
       -        text-decoration: none;
       -} 
       -
       -a:hover {
       -        color: #999;
       -}
       -
       -#menu {
       -        clear: both;
       -        color: #ccc;
       -        background-color: #057;
       -        padding: 0.7ex;
       -        font-size: 84%;
       -}
       -
       -#menu a {
       -        padding: 0.5ex 1ex 0.5ex 1ex;
       -        color: #eee;
       -}
       -
       -#menu a:hover {
       -        color: #ccc;
       -}
       -
       -#header {
       -        clear: both;
       -        color: #ddd;
       -        text-shadow: 1px 1px #000;
       -        font-size: 1.7em;
       -        padding: 0.7ex 0.7ex 0.7ex 0.7em;
       -        border-top: 1px solid #444;
       -}
       -
       -#header a {
       -        color: #ddd;
       -}
       -
       -h1 {
       -        margin: 1em 1ex 0.5ex 0;
       -        font-size: 1.4em;
       -}
       -
       -h2 {
       -        margin: 1em 1ex 0.5ex 0;
       -        font-size: 1.3em;
       -}
       -
       -h3 {
       -        margin: 1em 1ex 0.5ex 0;
       -        font-size: 1.2em;
       -}
       -
       -h4 {
       -        margin: 1em 1ex 0.5ex 0;
       -        font-size: 1.1em;
       -}
       -
       -#headerSubTitle {
       -        font-size: 0.8em;
       -        font-style: italic;
       -        margin-left: 1em;
       -}
       -
       -#content {
       -        clear: both;
       -        margin: 0;
       -        padding: 0;
       -        background-color: #222;
       -        overflow: hidden;
       -        border-top: 1px solid #444;
       -        border-bottom: 1px solid #444;
       -}
       -
       -#nav {
       -        background-color: #222;
       -        float: left;
       -        margin: 0 1px 0 0;
       -        padding: 1em 0;
       -        border-right: 1px dotted #444;
       -        width: 200px;
       -}
       -
       -#nav ul {
       -        margin: 0;
       -        padding: 0; 
       -}
       -
       -#nav li {
       -        list-style: none;
       -        padding: 0;
       -        margin: 0;
       -}
       -
       -#nav li ul {
       -  padding-left: 0.6em !important;
       -}
       -
       -#nav li a {
       -        color: #6af;
       -        display: block;
       -        margin: 0;
       -        padding: 0.8ex 2em 0.8ex 1em;
       -}
       -
       -#nav li a:hover {
       -        background: #057;
       -        color: #ddd;
       -}
       -
       -#nav li a.thisPage {
       -        color: #ddd;
       -        font-weight: bold;
       -        font-style: italic;
       -}
       -
       -#main {
       -        margin: 0 0 0 200px; 
       -        padding: 1.5em;
       -        max-width: 50em;
       -        text-align: justify;
       -}
       -
       -#ads {
       -        float:right;
       -        padding: 1em;
       -}
       -
       -#footer {
       -        clear: both;
       -        color: #ddd;
       -        font-size: 84%;
       -        padding: 1em;
       -        margin: 0 0 1.5em 0;
       -}
       -
       -.left {
       -        float: left;
       -        margin: 0;
       -        padding: 0;
       -}
       -
       -.right {
       -        float: right;
       -        margin: 0;
       -        padding: 0;
       -}
 (DIR) diff --git a/tpl/master.tpl b/tpl/master.tpl
       @@ -2,14 +2,7 @@
        <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>