aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2023-08-19 08:09:34 +0000
committerSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2023-08-19 08:09:34 +0000
commitac4fd34edfa1e5e2edb6fb9fc61acd782a0ed33b (patch)
tree0c83fcba33a3bd5204236a61981597093881681f
parent54bddf1684f7baf6c7243d703316e2d293b98c22 (diff)
downloaddoc-ac4fd34edfa1e5e2edb6fb9fc61acd782a0ed33b.tar.gz
doc-ac4fd34edfa1e5e2edb6fb9fc61acd782a0ed33b.zip
Doc: Move search functionality from DDG to our custom search engine
Move search functionality from DDG to our custom search engine. In this way we will improve the privacy since nobody outside the FreeBSD Project will have the data. Thanks to bapt@ to install and configure the search engine Approved by: doceng(implicit)
-rw-r--r--documentation/themes/beastie/layouts/partials/global-search.html10
-rwxr-xr-xdocumentation/themes/beastie/layouts/partials/site-header.html10
2 files changed, 8 insertions, 12 deletions
diff --git a/documentation/themes/beastie/layouts/partials/global-search.html b/documentation/themes/beastie/layouts/partials/global-search.html
index 414de88b13..26b3c0db4b 100644
--- a/documentation/themes/beastie/layouts/partials/global-search.html
+++ b/documentation/themes/beastie/layouts/partials/global-search.html
@@ -6,12 +6,10 @@
</a>
</div>
<p>{{ i18n "freebsd-documentation-main-desc" }}</p>
- <form class="search" method="get" id="search-form" action="https://duckduckgo.com/" onsubmit="document.getElementById('global-search-input').value+=' site:docs.FreeBSD.org OR site:man.FreeBSD.org OR site:wiki.FreeBSD.org'" name="search-form">
- <input type="hidden" name="ka" value="v">
- <input type="hidden" name="kt" value="v">
- <input type="hidden" name="kh" value="1">
- <input type="hidden" name="kj" value="r2">
- <input id="global-search-input" name="q" type="text" size="20" maxlength="255" onfocus="if( this.value==this.defaultValue ) this.value='';" value="" placeholder="{{ i18n "global-search-placeholder" }}">
+ {{ $currentLanguage := $.Site.Language }}
+ <form class="search" method="get" id="search-form" action="https://docs.freebsd.org/search" name="search-form">
+ <input type="hidden" name="DB" value="{{ $currentLanguage }}" />
+ <input id="global-search-input" name="P" type="text" size="20" maxlength="255" value="" placeholder="{{ i18n "global-search-placeholder" }}">
<span>&nbsp;</span>
</form>
</section>
diff --git a/documentation/themes/beastie/layouts/partials/site-header.html b/documentation/themes/beastie/layouts/partials/site-header.html
index 9c1af5071c..642ca7e468 100755
--- a/documentation/themes/beastie/layouts/partials/site-header.html
+++ b/documentation/themes/beastie/layouts/partials/site-header.html
@@ -86,12 +86,10 @@
</ul>
</nav>
<div class="search-donate-container">
- <form class="search" method="get" id="search-header-form" action="https://duckduckgo.com/" onsubmit="document.getElementById('words').value+=' site:FreeBSD.org'" name="search-header-form">
- <input type="hidden" name="ka" value="v" />
- <input type="hidden" name="kt" value="v" />
- <input type="hidden" name="kh" value="1" />
- <input type="hidden" name="kj" value="r2" />
- <input id="words" name="q" type="text" size="20" maxlength="255" onfocus="if( this.value==this.defaultValue ) this.value='';" />
+ {{ $currentLanguage := $.Site.Language }}
+ <form class="search" method="get" id="search-header-form" action="https://docs.freebsd.org/search" name="search-header-form">
+ <input type="hidden" name="DB" value="{{ $currentLanguage }}" />
+ <input id="words" name="P" type="text" size="20" maxlength="255" value="" />
<button>
<i class="fa fa-search" aria-hidden="true"></i>
</button>