esac \
| sort -u \
| while read -r page; do
- case $page in
- \#*|*/\#*) # Not a page directory (just a metadata dir)
- continue
- ;;
- \[*\]/*|*/\[*\]/*) # Omit "system" pages unless explicitly wanted
- [ "$glob_system_pages" != true ] \
- && continue \
- || pagedir="$(page_abs "$page")"
- ;;
- \:*|*/\:*) # Omit translation pages if translations are enabled
- [ "$LANGUAGE_DEFAULT" ] \
- && continue \
- || pagedir="$(page_abs "$page")"
- ;;
- *) pagedir="$(page_abs "$page")";;
- esac
+ # Not a page directory (just a metadata dir)
+ [ ! "${page%%#*}" -o ! "${page%%*/#*}" ] && continue
+
+ # Omit "system" pages unless explicitly wanted
+ [ ! "${page%%\[*\]/*}" -o ! "${page%%*/\[*\]/*}" ] && [ "$glob_system_pages" != true ] && continue
+
+ # Omit translation pages if translations are enabled
+ [ ! "${page%%:*}" -o ! "${page%%*/:*}" ] && [ "$LANGUAGE_DEFAULT" ] && continue
+
+ pagedir="$(page_abs "$page")"
+
if [ -d "$_DATA/pages/$pagedir" -o -d "$_EXEC/pages/$pagedir" ]; then
printf '%s\n' "$page"
if ! [ "$depth" -eq 0 ]; then