]> git.plutz.net Git - shellwiki/blobdiff - macros/pagelist
Merge commit '1b333027ebf2f2cef52548ad5e5f342dcf954464'
[shellwiki] / macros / pagelist
index e8e9b04ad486aac46e829a3c7597e31b664af61a..54d4a693f2f0d8d2d0fc76bb40b3bbe3b50d6077 100755 (executable)
@@ -10,13 +10,11 @@ depth="${2:-1}"
 printf '<ul class="pagelist">\n'
   page_glob "$dir" \
   | while read -r glob; do
-    page_children "$glob" "$depth"
+    printf %s\\n "$glob"
+    page_children "$glob" "$((depth - 1))"
   done \
   | while read -r page; do
-    case $page in
-      /*) pagedir="$(PATH "$page")";;
-      *)  pagedir="$(PATH "$PATH_INFO/$page")";;
-    esac
+    pagedir="$(page_abs "$page")"
     [ -f "$_DATA/pages/${pagedir}/#page.md" -o \
       -f "$_EXEC/pages/${pagedir}/#page.md" ] \
     && acl_read "$pagedir" \