diff --git a/bin/controller.rc b/bin/controller.rc index 9069ffc..6e2320e 100755 --- a/bin/controller.rc +++ b/bin/controller.rc @@ -30,7 +30,7 @@ dirfilter = '/\/[._]/d; s,^\.\.*/,.,; s,\.md$,,; s,\.html,,;' # Sidebar fn menu { - lsArgs = ( '-F' ) + lsArgs = ('-F') # XXX will not work properly for $#blogDirs > 1 and matching is hackish if ( (! ~ $#inBlog 0) || ! ~ $#blogDirs 0 && (~ $blogDirs^/ *$1 *$1/) ) { # Work in progress XXX lsArgs = ($lsArgs -r) @@ -88,27 +88,27 @@ fn blogTitle { # Body fn genbody { - if ( test -f $body.md ) { - if ( ! ~ $#inBlog 0 ) + if (test -f $body.md) { + if (! ~ $#inBlog 0) blogTitle $body.md | $formatter $formatter < $body.md } - if not if ( test -f $body.tpl ) + if not if (test -f $body.tpl) template.awk $body.tpl | rc $rcargs - if not if ( test -f $body.txt ) { + if not if (test -f $body.txt) { echo '
'
# XXX Insering a blank line between lines in input is good for fortunes.txt, but probably not for other .txt files
# XXX Words are not broken, even if they are way beyond 82 chars long
cat $body.txt |sed 's/$/\n/g; s/\>/g; s/>/\</g' |fmt -l 82 -j
echo ''
}
- if not if ( test -f $body.html )
+ if not if (test -f $body.html)
cat $body.html | /bin/sed '0,/<[Bb][Oo][Dd][Yy][^>]*>/d; /<\/[Bb][Oo][Dd][Yy]>/,$d'
- if not if (~ $body *.html && test -f $body )
+ if not if (~ $body *.html && test -f $body)
cat $body | /bin/sed -i '0,/]*>/d;/<\/body>/,$d' # This branch is never taken?
- if not if ( ~ $body */[bB]log/index */[bB]log//index && ~ $#blogDirs 0 )
+ if not if (~ $body */[bB]log/index */[bB]log//index && ~ $#blogDirs 0)
blogDirs = `{basename -d $body}
- if not if ( test -f pub/^$reqpath^.tpl )
+ if not if (test -f pub/^$reqpath^.tpl)
template.awk pub/^$reqpath^.tpl | rc $rcargs
if not if(~ $body */index && ~ $#blogDirs 0) {
echo '