From b1df2966e3393c1c8d77c3ce57bc132c06ba8bcf Mon Sep 17 00:00:00 2001 From: Uriel Date: Sun, 8 Mar 2009 23:58:49 +0100 Subject: [PATCH] New api to allow 'synthetic' dirs, only for sidebar for now. --- bin/corehandlers.rc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/corehandlers.rc b/bin/corehandlers.rc index 137c6d9..3e8ac5b 100644 --- a/bin/corehandlers.rc +++ b/bin/corehandlers.rc @@ -1,13 +1,20 @@ # Werc builtin handlers +# API +fn add_synth_paths { + synth_paths=($synth_paths $conf_wd^$*) +} + fn nav_tree { if(! ~ $#sideBarNavTitle 0) echo '
'$"sideBarNavTitle':
' # Ignore stderr, last path element might be a file that doesn't exist (eg., foo for foo.md) # /./ to deal with p9p's ls failure to follow dir symlinks otherwise ls -F $sitedir/./$req_paths_list >[2]/dev/null \ - | sed $dirfilter'/\/[^_.\/][^\/]*(\.(md|txt|html)|\/)$/!d; s!^'$sitedir'!!; '$dirclean \ - | sort -u | awk -F/ ' + | { + sed $dirfilter'/\/[^_.\/][^\/]*(\.(md|txt|html)|\/)$/!d; s!^'$sitedir'!!; '$dirclean + if(! ~ $#synth_paths 0) echo $synth_paths | tr ' ' $NEW_LINE + } | sort -u | awk -F/ ' function p(x, y, s) { for(i=0; i < x-y; i+=1) print s } BEGIN { lNF=2; print "