X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=handlers%2F40_search.sh;h=d198f220756319f457783e95af36d43d9114351e;hb=35c700335c55a0819e3582a77211e3cb280f48fe;hp=1d37989eb4c760679e63dd096a6b9e68dbf5153b;hpb=d9a3dee90a669c88bd6b4b0fa553e01ed1e729a1;p=shellwiki diff --git a/handlers/40_search.sh b/handlers/40_search.sh index 1d37989..d198f22 100644 --- a/handlers/40_search.sh +++ b/handlers/40_search.sh @@ -36,17 +36,12 @@ 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")" + printf '%s\n' "$page" done \ -| theme_page - <<-EOF -
    -
    -

    $(_ "Search results")

    - -
    -
      - $(cat) -
    -
    - EOF +| theme_search "${words% }"