apps: rename 'search' to 'duckduckgo'
just in case we want to bring in a 'real' search app like e.g. the one in wercchan, for which see https://github.com/kfarwell/werchan/tree/master/apps/search
This commit is contained in:
parent
32cf41e25c
commit
1ef0fdb99f
@ -3,7 +3,7 @@ that default, you could enable site search like so:
|
||||
|
||||
|
||||
mkdir -p /www/werc/sites/MYSITE/_search/_werc/
|
||||
echo 'conf_enable_search' > /www/werc/sites/MYSITE/_search/_werc/config
|
||||
echo 'conf_enable_duckduckgo' > /www/werc/sites/MYSITE/_search/_werc/config
|
||||
mkdir -p /www/werc/sites/MYSITE/_werc/lib/
|
||||
cp /www/werc/apps/search/footer.inc.sample /www/werc/sites/MYSITE/_werc/lib/
|
||||
|
@ -1,22 +1,22 @@
|
||||
fn conf_enable_search {
|
||||
enable_search=yes
|
||||
conf_enable_app search
|
||||
fn conf_enable_duckduckgo {
|
||||
enable_duckduckgo=yes
|
||||
conf_enable_app duckduckgo
|
||||
pageTitle='Site Search'
|
||||
}
|
||||
|
||||
|
||||
fn search_init {
|
||||
fn duckduckgo_init {
|
||||
get_post_args q
|
||||
if (! ~ $#q 0) {
|
||||
redirect_string = 'https://duckduckgo.com/?q=site:'$SERVER_NAME^'+'^$"q
|
||||
http_redirect $redirect_string '302 Found'
|
||||
}
|
||||
if not {
|
||||
handler_body_main='search_body'
|
||||
handler_body_main='duckduckgo_body'
|
||||
}
|
||||
}
|
||||
|
||||
fn search_body {
|
||||
fn duckduckgo_body {
|
||||
echo '
|
||||
<h1>Site search</h1>
|
||||
<h3>using DuckDuckGo</h3>
|
Loading…
Reference in New Issue
Block a user