X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=zk.zsh;h=b6ac72d05e46e06d663e437ca9a5a41ddf2459e5;hb=95c1084debae483c5674606175d7e9903675643e;hp=d583ae3d5d3dc5a990578bad5599916e9605a347;hpb=5264b1f98b851978e5794c51ed38e18b177fd143;p=zk.zsh.git diff --git a/zk.zsh b/zk.zsh index d583ae3..b6ac72d 100755 --- a/zk.zsh +++ b/zk.zsh @@ -156,25 +156,30 @@ genIndex() { typeset -aU cats=() local curdepth=${#${(s:/:)1}} (( curdepth = curdepth + 1 )) - for p (${(oi)${(k)pages[(I)$1*]}}) { - [[ ( $p =~ "/index$" ) || ( $p = "index" ) ]] && continue + for p (${(k)pages[(I)$1*]}) { case ${#${(As:/:)p}} in ($curdepth) _links=($p $_links) ;; ( $(( $curdepth + 1 )) ) cats=(${1}${${p#$1}%%/*} $cats) ;; (*) continue ;; esac } - for p (${(oi)_links}) \ - entries=($entries "[$p] (${pages[$p]}) (${sizes[$p]} bytes)") + local page=${1}index + print " +$page ($now)" if [[ $cats ]]; then - entries=($entries $separator "Subdirectories:" $separator) + print "
Subdirectories:" fi - links[${1}index]=${(j: :)_links} - genHTML ${1}index ${(F)entries} + print "" } case $1 in @@ -188,8 +193,6 @@ case $1 in genHTML $p > $2/$p.html touch -r $p $2/$p.html } - for p ($cats) pages[${p}/index]=$now - pages[index]=$now for p ($cats) genIndex $p/ > $2/$p/index.html genIndex "" > $2/index.html for p ("" $cats) touch -d ${now/ /T} $2/$p/index.html