]> git.plutz.net Git - shellwiki/commitdiff
omit empty pages from display
authorPaul Hänsch <paul@plutz.net>
Tue, 17 May 2022 12:13:42 +0000 (14:13 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 17 May 2022 12:13:42 +0000 (14:13 +0200)
macros/pagelist

index 24252a920c6fc2f1e55dad4a666e4fff7cf3f836..e8e9b04ad486aac46e829a3c7597e31b664af61a 100755 (executable)
@@ -17,7 +17,9 @@ printf '<ul class="pagelist">\n'
       /*) pagedir="$(PATH "$page")";;
       *)  pagedir="$(PATH "$PATH_INFO/$page")";;
     esac
-    acl_read "$pagedir" \
+    [ -f "$_DATA/pages/${pagedir}/#page.md" -o \
+      -f "$_EXEC/pages/${pagedir}/#page.md" ] \
+    && acl_read "$pagedir" \
     && printf '<li><a href="%s">%s</a></li>' "$(HTML "$page")" "$(HTML "$page")"
   done
 printf '</ul>\n'