swerc

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

commit 584eab329b6ed2b437990b1dd368c3c93da7b053
parent b59295a69d369a93013eb07b94169908f1cfbd18
Author: kris@engel.se.cat-v.org <unknown>
Date:   Mon,  4 Jun 2007 06:34:33 +0200

Fix sed snafu.
Diffstat:
Mbin/controller.rc | 27+++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/bin/controller.rc b/bin/controller.rc @@ -25,7 +25,7 @@ fn gentitle { echo '<h1 class="headerTitle"><a href="/">' ^ $"siteTitle ^ '<span id="headerSubTitle">' ^ $"siteSubTitle ^ '</span></a></h1>' } -dirfilter = '/\/./d; /\/_[^\/]*$/d; s,^\./,,; s,\.md$,,;' +dirfilter = '/\/\./d; /\/_[^\/]*$/d; s,^\./,,; s,\.md$,,;' # Sidebar fn menu { @@ -34,7 +34,6 @@ fn menu { END { print "</ul>" } /^([a-zA-Z0-9+_\-]+[\/*]?)+$/ && $NF != "index" { isdir = match($0, "/$") - sub("[*/]$", "") bname = $0 @@ -124,18 +123,6 @@ if (! ~ $#sidebar 0) if (test -d $body) body=$body/index -fn template { - template.awk | rc | - awk '{ - buf = buf $0"\n" - if(length(buf) > 8192) { - printf "%s", buf - buf = "" - } - } - END{ printf "%s", buf }' -} - # RSS fn statpost { f = $1 @@ -157,6 +144,18 @@ fn statpost { } } +fn template { + template.awk | rc | + awk '{ + buf = buf $0"\n" + if(length(buf) > 8192) { + printf "%s", buf + buf = "" + } + } + END{ printf "%s", buf }' +} + if(! ~ $REQUEST_URI */index.rss) { cat $headers $template | template exit