]> git.plutz.net Git - shellwiki/blobdiff - themes/default.sh
define search function as macro
[shellwiki] / themes / default.sh
index d13e849f72ece086e4fb9a456f2fbe2419ea5f3d..5ebbd0ef6964180a146ea96b10ddf5a2ee5658ec 100755 (executable)
@@ -135,31 +135,6 @@ theme_editor(){
 
 theme_revisions(){ theme_page "$@"; }
 
-theme_search(){
-  local words="$*"
-  # STDIN: [STRING page][TAB][STRING teaser]
-
-  theme_page - "$(_ Search results): ${words}" <<-EOF
-       <article>
-         <h1>$([ "$words" ] && _ "Search results" || _ "Search" )</h1>
-         <form class="search" method="GET">
-           <input type="search" name="q" value="$(GET q |HTML)"><button class="search" type="submit">$(_ Search)</button>
-         </form>
-         <ol class="searchresults">
-           $(while read -r p t; do
-             path="$(UNSTRING "$p")" pfrag="${path%/}" title=''
-              while [ "$pfrag" ]; do
-                title="$(page_title "$pfrag")/$title"
-                pfrag="${pfrag%/*}"
-              done
-             printf '<li><a href="%s">%s</a><p>%s</p></li>' \
-                "$(URL "$path")" "$(HTML "/$title")" "$(UNSTRING "$t" |HTML)"
-           done)
-         </ol>
-       </article>
-       EOF
-}
-
 theme_attachments(){
   local page="$1"