346bd1cd53e1bd3bd881f94552efadeebab430e4
- Author
- Josh Hubbard <jhubbardsf@gmail.com>
- Committer
- Carlo Sala <carlosalag@protonmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md
2index 619d31e7f4bc902bd0a9e7de817fba3030d11878..92079506094b3c88f5ecbe70a9cf349a1d2dbedd 100644
3--- a/plugins/frontend-search/README.md
4+++ b/plugins/frontend-search/README.md
5@@ -66,7 +66,16 @@ If you want to have another context, open an Issue and tell us!
6
7 ## Fallback search behaviour
8
9diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh
10index 541b23701bd88303f3613acb9048c9429bec5cc5..c96596eb96db3ef0f1be2dc56920d14887ca54f1 100644
11--- a/plugins/frontend-search/frontend-search.plugin.zsh
12+++ b/plugins/frontend-search/frontend-search.plugin.zsh
13@@ -30,10 +30,16 @@ alias vuejs='frontend vuejs'
14 alias nextjs='frontend nextjs'
15
16 function _frontend_fallback() {
17- case "$FRONTEND_SEARCH_FALLBACK" in
18- duckduckgo) echo "https://duckduckgo.com/?sites=$1&q=" ;;
19- *) echo "https://google.com/search?as_sitesearch=$1&as_q=" ;;
20- esac
21+ if [[ "$FRONTEND_SEARCH_FALLBACK_LUCKY" == "true" ]]; then
22+ case true in
23+ *) echo "https://duckduckgo.com/?q=!ducky+site%3A$1+" ;;
24+ esac
25+ else
26+ case "$FRONTEND_SEARCH_FALLBACK" in
27+ duckduckgo) echo "https://duckduckgo.com/?sites=$1&q=" ;;
28+ *) echo "https://google.com/search?as_sitesearch=$1&as_q=" ;;
29+ esac
30+ fi
31 }
32
33 function frontend() {