From: Paul Hänsch Date: Sun, 7 Apr 2024 14:41:06 +0000 (+0200) Subject: remove search from wikiform macro X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=6a9f5a21897f72c61f297b256c5512d5e1b8c667;p=shellwiki remove search from wikiform macro --- diff --git a/macros/search b/macros/search index b3d06e8..b603050 100755 --- a/macros/search +++ b/macros/search @@ -25,7 +25,7 @@ I="$_DATA/index" _(){ printf %s\\n "$*"; } [ "${LANGUAGE}" -a -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh" -show_form=true show_hits='' action='' +show_form=true show_hits='' action='' query='' set -- "$@" -- while [ $# -gt 0 ]; do case $1 in @@ -41,6 +41,8 @@ while [ $# -gt 0 ]; do case $1 in *) set -- "$@" "$1"; shift 1;; esac; done +[ $@ -gt 0 ] && query="$*" || query="$(GET q)" + searchteaser() { local file="$1" words db3_data local w l nc nl hits mhits cont mcont @@ -79,14 +81,18 @@ elif [ ! "$action" ]; then fi if [ "${show_form}" = true ]; then - printf '' "$action" "$(_ Search)" "$([ "$show_hits" = true ] && GET q |HTML)" "$(_ Search)" + cat <<-EOF + + EOF fi if [ "${show_hits}" = true ]; then { read tags; read ntags; read words; } <<-EOF - $(GET q | awk ' + $(printf %s\\n "${query}" | awk ' BEGIN { # Field separator FS should include punctuation, including Unicode Block U+2000 - U+206F if ( length("¡") == 1 ) # Utf-8 aware AWK FS = "([] \\t\\n\\r\"'\''()*+,./:;<=>?\\\\^_`{|}~[-]|%[0-9A-Fa-f]{2}|'"$(printf '[\342\200\200-\342\201\257]')"')+"; diff --git a/macros/wikiform b/macros/wikiform index 257a22e..fe3dbd1 100755 --- a/macros/wikiform +++ b/macros/wikiform @@ -35,15 +35,4 @@ case $action in settings) w_user_update |"$_EXEC/cgilite/html-sh.sed" ;; - search) - if [ "$LANGUAGE_DEFAULT" ]; then - printf '' "$LANGUAGE" "$(_ Search)" "$(_ Search)" - else - printf '' "$(_ Search)" "$(_ Search)" - fi - ;; esac diff --git a/pages/#page.md b/pages/#page.md index 0a4ba30..ce03c12 100644 --- a/pages/#page.md +++ b/pages/#page.md @@ -5,7 +5,7 @@ It Works! ========= -<> +<> ::: {center} You have set up a lightweight website that you can fill with content as you like. diff --git a/pages/:de/#page.md b/pages/:de/#page.md index 6bc9b5d..6c1e1ef 100644 --- a/pages/:de/#page.md +++ b/pages/:de/#page.md @@ -5,7 +5,7 @@ Es Funktioniert! ================ -<> +<> ::: {center} Sie haben eine leichtgewichtige Webseite eingerichtet, die Sie nach belieben mit Inhalten füllen können. diff --git a/pages/[wiki]/header/#page.md b/pages/[wiki]/header/#page.md index 8ecd0d9..1d9f629 100644 --- a/pages/[wiki]/header/#page.md +++ b/pages/[wiki]/header/#page.md @@ -4,7 +4,7 @@ -------------- ::: { right } -<> +<> ::: ::: { menu } * [Help](/[wiki]/editorhelp/) diff --git a/pages/[wiki]/header/:de/#page.md b/pages/[wiki]/header/:de/#page.md index 85edc74..d94a55a 100644 --- a/pages/[wiki]/header/:de/#page.md +++ b/pages/[wiki]/header/:de/#page.md @@ -4,7 +4,7 @@ -------------- ::: { right } -<> +<> ::: ::: { .menu } * [Hilfe](/[wiki]/editorhelp/)