Add kapa AI (#2925)
diff --git a/.htaccess b/.htaccess
index a98514a..08679ee 100644
--- a/.htaccess
+++ b/.htaccess
@@ -7,6 +7,7 @@
Header always set Cache-Control "no-store, no-cache, must-revalidate"
Header always set Expires "Thu, 01 Dec 1994 16:00:00 GMT"
Header always merge Vary "Accept-Language"
+ Header set Content-Security-Policy "frame-src 'self' https://www.google.com https://app.netlify.com"
</IfModule>
<IfModule mod_rewrite.c>
diff --git a/.htmltest.yml b/.htmltest.yml
index 585eb89..297b352 100644
--- a/.htmltest.yml
+++ b/.htmltest.yml
@@ -24,6 +24,9 @@
"https://www.baeldung.com/bdd-mockito",
"https://docs.github.com/.*",
"http://hessian.caucho.com/.*",
+ "https://stackoverflow.com/.*",
+ "http://stackoverflow.com/.*",
+ "https://unix.stackexchange.com/.*",
"https://doi.org/10.1145/3593856.3595909",
"https://github.com/dubbo/awesome-dubbo/blob/master/slides/meetup/201812%40hangzhou/troubleshooting-dubbo-with-arthas.pdf",
"https://apachecon.dukecon.org/acna/2018/#/scheduledEvent/b8db9dc580d85853f",
diff --git a/cn_config.toml b/cn_config.toml
index 2692a49..47c4142 100644
--- a/cn_config.toml
+++ b/cn_config.toml
@@ -99,7 +99,7 @@
#gcs_engine_id = "011737558837375720776:fsdu1nryfng"
-algolia_docsearch = true
+algolia_docsearch = false
offlineSearch = false
diff --git a/config.toml b/config.toml
index 52c3c7a..74a255f 100644
--- a/config.toml
+++ b/config.toml
@@ -93,7 +93,7 @@
#gcs_engine_id = "011737558837375720776:fsdu1nryfng"
-algolia_docsearch = true
+algolia_docsearch = false
offlineSearch = false
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 650af5c..dee1328 100755
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -30,6 +30,8 @@
<!-- Docsy head.html begins here -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+<!--Google needs to be allowed for kapa.ai widget to work-->
+<meta http-equiv="Content-Security-Policy" content="frame-src 'self' https://www.google.com/ https://app.netlify.com/;">
{{ hugo.Generator }}
{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index f4c985b..bc86326 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -20,4 +20,23 @@
<!-- scripts for prism -->
<script src='/js/prism.js'></script>
{{ end }}
+
+<script async
+ src="https://widget.kapa.ai/kapa-widget.bundle.js"
+ data-website-id="d763c4f2-f871-400b-aeca-d986c4af73c2"
+ data-project-name="Apache Dubbo"
+ data-project-color="#E8442E"
+ data-button-text="Ask AI"
+ data-search-mode-enabled="true"
+ data-modal-open-on-command-k="true"
+ data-modal-disclaimer="The AI supports multiple languages, but it may not be accessible in China due to recaptcha, a proxy is required."
+ data-project-logo="https://pbs.twimg.com/profile_images/1011849068283191302/FJbH5vbF_400x400.jpg"
+ data-modal-example-questions="What is Apache Dubbo?,How to run Apache Dubbo?"
+ data-button-position-top=""
+ data-button-position-right="20px"
+ data-button-position-bottom="200px"
+ data-button-position-left=""
+></script>
+
+
{{ partial "hooks/body-end.html" . }}