separator="------------------------ >8 ------------------------"
setopt GLOB_STAR_SHORT
zmodload -F zsh/stat b:zstat
-typeset -A pages
+typeset -A mtimes
typeset -A sizes
for p (**(.)) {
[[ $p:t == "index" ]] && {
}
zstat -A mtime -F "%F %T" +mtime $p
zstat -A size +size $p
- pages[$p]=${mtime[1]}
+ mtimes[$p]=${mtime[1]}
sizes[$p]=${size[1]}
}
typeset -A cats
typeset -A backs
typeset -A cached
typeset -aU ws
-for p (${(k)pages}) {
+for p (${(k)mtimes}) {
[[ $ZK_CACHE ]] && {
zstat -A inode +inode $p
zstat -A ctime +ctime $p
ws=($ws $w)
continue
}
- [[ ${pages[$w]} ]] || {
+ [[ ${mtimes[$w]} ]] || {
[[ $ZK_SHOW_MISSING ]] && print "missing $w"
continue
}
print "<hr/>Links:<ul>"
for p ($_links) {
getrel $page $p
- print "<li><a href=\"${REPLY}.html\">$p</a> <sup>${pages[$p]}</sup></li>"
+ print "<li><a href=\"${REPLY}.html\">$p</a> <sup>${mtimes[$p]}</sup></li>"
}
print "</ul>"
fi
print "<hr/>Backlinks:<ul>"
for p ($bs) {
getrel $page $p
- print "<li><a href=\"${REPLY}.html\">$p</a> <sup>${pages[$p]}</sup></li>"
+ print "<li><a href=\"${REPLY}.html\">$p</a> <sup>${mtimes[$p]}</sup></li>"
}
print "</ul>"
fi
typeset -aU _cats=()
local curdepth=${#${(s:/:)1}}
(( curdepth = curdepth + 1 ))
- for p (${(k)pages[(I)$1*]}) {
+ for p (${(k)mtimes[(I)$1*]}) {
case ${#${(As:/:)p}} in
($curdepth) _links=($p $_links) ;;
( $(( $curdepth + 1 )) ) _cats=(${1}${${p#$1}%%/*} $_cats) ;;
</head><body><ul>"
for p (${(oi)_links}) {
getrel $page $p
- print "<li><a href=\"${REPLY}.html\">$p</a> <sup>${pages[$p]}</sup> (${sizes[$p]} bytes)</li>"
+ print "<li><a href=\"${REPLY}.html\">$p</a> <sup>${mtimes[$p]}</sup> (${sizes[$p]} bytes)</li>"
}
print "</ul>"
if [[ $_cats ]]; then
print "<hr/>Backlinks:<ul>"
for p ($bs) {
getrel $page $p
- print "<li><a href=\"${REPLY}.html\">$p</a> <sup>${pages[$p]}</sup></li>"
+ print "<li><a href=\"${REPLY}.html\">$p</a> <sup>${mtimes[$p]}</sup></li>"
}
print "</ul>"
fi
(html) genHTML $2 ;;
(html-index) genIndex $2 ;;
(htmls)
- for p (${(k)pages}) {
+ for p (${(k)mtimes}) {
zf_mkdir -p $2/$p:h
genHTML $p > $2/$p.html
touch -r $p $2/$p.html