X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=list.sh;h=ccb91393dec2821f375cf797f485b86a772dafa0;hb=47009795c4998f1571a6f97de463d43f73defdc4;hp=86b60fd55f3a0260fcf5c246db312d091f6f2fec;hpb=f43a20b6cac2227e7bd192b92608c9fc4be89e85;p=serve0 diff --git a/list.sh b/list.sh index 86b60fd..ccb9139 100755 --- a/list.sh +++ b/list.sh @@ -7,11 +7,6 @@ list_item() { local meta file link name eval "$LOCAL_META" - meta="${1}"; - - read_meta <<-EOF - $meta - EOF if [ "${META_NAME%/}" != "${META_NAME}" ]; then printf '[a .list .dir href="%s?%s" . %s]' \ @@ -164,9 +159,14 @@ list_paginate() { end=$((page + LISTSIZE)) printf '[div .itemlist ' - while read -r i; do + while :; do c=$((c + 1)) - [ $c -gt $page -a $c -le $end ] && list_item "$i" + if [ $c -gt $page -a $c -le $end ]; then + read_meta || break + list_item + else + read -r discard || break + fi done printf ']'