$([ "$words" ] && _ "Search results" || _ "Search" )
+ +-
+ $( while read p; do
+ printf '
- %s ' "$(URL "$p")" "$(HTML "$p")" + done) +
X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;ds=inline;f=themes%2Fdefault.sh;h=5b2f1edd55a261ec566e37820c122af0d8a08313;hb=2506cfcd83b7247d669818e3cdf8d34b0b04404a;hp=85febeef60e7274563a2e62c0d59698e7088bb12;hpb=a08c8812fcd778738c0b7a983c4778e0503cddb1;p=shellwiki diff --git a/themes/default.sh b/themes/default.sh index 85febee..5b2f1ed 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -83,12 +83,11 @@ theme_page(){ } theme_editor(){ - local page="$1" template="$2" title file att - title="$(HTML "${PAGE_TITLE:-"${page}"}")" + local page="$1" template="$2" file att [ "$template" ] && acl_read "$template" || template="$page" - theme_page - "Editor: $title" <<-EOF + theme_page - "$(_ Editor): ${PAGE_TITLE:-"${page}"}" <<-EOF @@ -108,17 +107,21 @@ theme_editor(){ $(for file in "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments"/* "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments"/*; do [ "$file" = "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" \ -a -f "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" ] && continue + att="$(HTML "${file##*/}")" + url="$(printf %s\\n "${file##*/}" |sed 's;[\\<>];\\&;g' |HTML)" + name="$(printf %s\\n "${file##*/}" |sed 's;[]\\[];\\&;g' |HTML)" case ${file##*/} in \*) continue;; *.[pP][nN][gG]|*.[jJ][pP][gG]|*.[jJ][pP][eE][gG]|*.[gG][iI][fF]) [ "$page" != "${page%/:$LANGUAGE/}" ] && p=../ || p='' - att="$(HTML "${file##*/}")" - printf '
![](%s)
![](<%s>)
[%s](%s)
' "$att" "$att" + printf '[%s](<%s>)
' "$name" "$url" ;; esac done) @@ -131,12 +134,30 @@ theme_editor(){ theme_revisions(){ theme_page "$@"; } +theme_search(){ + local words="$*" + # STDIN: read result pages line by line + + theme_page - "$(_ Search results): ${words}" <<-EOF +