This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/master by this push:
new 642ef4a82a Update docsearch (#1324)
642ef4a82a is described below
commit 642ef4a82a1e9854a19c9a7ac88b4d9767d674d0
Author: Albumen Kevin <[email protected]>
AuthorDate: Tue Aug 2 11:00:56 2022 +0800
Update docsearch (#1324)
---
layouts/partials/hooks/body-end.html | 20 ++++++++++++++------
layouts/partials/search-input.html | 3 +++
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/layouts/partials/hooks/body-end.html
b/layouts/partials/hooks/body-end.html
index a88dade516..bada7a520a 100644
--- a/layouts/partials/hooks/body-end.html
+++ b/layouts/partials/hooks/body-end.html
@@ -1,9 +1,17 @@
{{ with .Site.Params.algolia_docsearch }}
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
-<script type="text/javascript">docsearch({
- container: '.td-search-input',
- appId: 'BVDW4O6RT8',
- apiKey: 'ac93e2697aa2f34e154cb3f0a3a069ae',
- indexName: 'apache_dubbo',
-});</script>
+<script>
+ docsearch({
+ // Your apiKey and indexName will be given to you once
+ // we create your config
+ appId: 'BVDW4O6RT8',
+ apiKey: 'ac93e2697aa2f34e154cb3f0a3a069ae',
+ indexName: 'apache_dubbo',
+ // Replace inputSelector with a CSS selector
+ // matching your search input
+ container: '#docsearch',
+ // Set debug to true to inspect the dropdown
+ debug: false,
+ });
+</script>
{{ end }}
\ No newline at end of file
diff --git a/layouts/partials/search-input.html
b/layouts/partials/search-input.html
new file mode 100644
index 0000000000..26c8198472
--- /dev/null
+++ b/layouts/partials/search-input.html
@@ -0,0 +1,3 @@
+{{ if .Site.Params.algolia_docsearch -}}
+<div id="docsearch"></div>
+{{ end -}}