diff --git a/apps/bridge/app.rc b/apps/bridge/app.rc index 31cd15b..a8b19ef 100644 --- a/apps/bridge/app.rc +++ b/apps/bridge/app.rc @@ -1,9 +1,7 @@ fn bridge_init { - # XXX: Should avoid running for 404s, dir lists, etc. - if(! ~ $#enable_comments 0) { - ll_add handlers_body_foot bridge_body_foot + if(! ~ $#enable_comments 0 && test -f $local_path.md) { + ll_add handlers_body_foot template apps/bridge/foot.tpl if(get_post_args comment_text) { - dprint POST COMMNET $"comment_text d=`{date -n} # FIXME Obvious race d=$local_path^'_werc/comments/'^$d/ @@ -29,7 +27,3 @@ fn bridge_init { } -fn bridge_body_foot { - template apps/bridge/foot.tpl -} - diff --git a/apps/bridge/foot.tpl b/apps/bridge/foot.tpl index 674530e..8058c2d 100644 --- a/apps/bridge/foot.tpl +++ b/apps/bridge/foot.tpl @@ -2,8 +2,9 @@ % if(test -d $cdir) {

Comments

% for(c in `{ls $cdir/}) { -
By: +
By: % cat $c/user +
% cat $c/body | escape_html | sed 's,$,
,'