From: Paul Hänsch Date: Fri, 22 Sep 2023 15:26:37 +0000 (+0200) Subject: filter foreign languages and system pages from search results X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=9093deb385bb32eddd5149cd68c3eecb65a9c415;p=shellwiki filter foreign languages and system pages from search results --- diff --git a/handlers/40_search.sh b/handlers/40_search.sh index f057e45..823ef76 100644 --- a/handlers/40_search.sh +++ b/handlers/40_search.sh @@ -36,6 +36,11 @@ done \ | sort -nr \ | while read freq doc; do page="$(UNSTRING "$doc")" + [ "${page%*/\[*\]/*}" != "$page" ] && continue + if [ "$LANGUAGE_DEFAULT" ]; then + [ -d "${_DATA}/pages/${page}/:${LANGUAGE}/" ] && continue + [ "${page%/:*/}" = "${page%/:${LANGUAGE}/}" ] || continue + fi acl_read "$page" || continue printf '
  • %s
  • ' "$(URL "$page")" "$(HTML "$page")" done \