diff --git a/bin/controller.rc b/bin/controller.rc index 991d483..d29b5a5 100755 --- a/bin/controller.rc +++ b/bin/controller.rc @@ -25,7 +25,7 @@ fn gentitle { echo '

' ^ $"siteTitle ^ '' ^ $"siteSubTitle ^ '

' } -dirfilter = '/\/./d; /\/_[^\/]*$/d; s,^\./,,; s,\.md$,,;' +dirfilter = '/\/\./d; /\/_[^\/]*$/d; s,^\./,,; s,\.md$,,;' # Sidebar fn menu { @@ -34,7 +34,6 @@ fn menu { END { print "" } /^([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