This is an automated email from the ASF dual-hosted git repository.
xyz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new 6ddab131bdc Add Ask AI for Pulsar documentation (#1061)
6ddab131bdc is described below
commit 6ddab131bdcb692b3db50a5f8e46b78bedd8943e
Author: Zike Yang <[email protected]>
AuthorDate: Wed Dec 10 14:56:00 2025 +0800
Add Ask AI for Pulsar documentation (#1061)
---
docusaurus.config.ts | 22 ++++++++++++++++++++++
static/.htaccess | 4 ++++
2 files changed, 26 insertions(+)
diff --git a/docusaurus.config.ts b/docusaurus.config.ts
index 698c316b0e3..5d8f24eab82 100644
--- a/docusaurus.config.ts
+++ b/docusaurus.config.ts
@@ -540,6 +540,28 @@ module.exports = async function createConfigAsync() {
scripts: [
{ src: "/js/sine-waves.min.js", async: true },
"/js/matomo-agent.js",
+ '/js/custom-script.js',
+ {
+ async: true,
+ src: 'https://widget.kapa.ai/kapa-widget.bundle.js',
+ 'data-website-id': '7da3a42b-98f7-4af5-85e9-771d51c21796',
+ 'data-modal-title': 'Apache Pulsar AI Assistant',
+ 'data-project-name': 'Apache Pulsar',
+ 'data-project-logo':
'https://pbs.twimg.com/profile_images/875130220474359809/wFcLUbwd_400x400.jpg',
+ 'data-project-color': '#FFFFFF',
+ 'data-modal-open-by-default': 'true',
+ 'data-bot-protection-mechanism': 'hcaptcha',
+ 'data-modal-override-open-id': 'ask-ai-input',
+ 'data-modal-override-open-class': 'search-input',
+ 'data-user-analytics-fingerprint-enabled': 'true',
+ 'data-button-text-color': '#136EC4',
+ 'data-modal-example-questions-title': 'Try asking me...',
+ 'data-modal-example-questions': 'How to create a topic?,How does
message retention work?,What is a Pulsar broker?,How does geo-replication
work?',
+ 'data-modal-disclaimer': 'This is a custom LLM with access to all
Pulsar documentation.',
+ 'data-consent-required': true,
+ 'data-consent-screen-disclaimer': "By clicking "I agree, let's
chat", you consent to the use of the AI assistant in accordance with
kapa.ai's Privacy Policy. This service uses reCAPTCHA, which requires your
consent to Google Privacy Policy and Terms of Service.",
+ 'data-user-analytics-cookie-enabled': false,
+ }
],
clientModules: [require.resolve("./matomoClientModule.ts")],
stylesheets: [
diff --git a/static/.htaccess b/static/.htaccess
index e9cc667933f..c8b4fac5b62 100755
--- a/static/.htaccess
+++ b/static/.htaccess
@@ -30,3 +30,7 @@ RewriteRule "^contribute/version-policy/?$"
"/contribute/release-policy" [R=301,
RewriteRule "^coding-guide/?$" "/contribute/develop-coding-conventions"
[R=301,DPI,L]
RewriteRule "^contributing/?$" "/contribute" [R=301,DPI,L]
RewriteRule "^pulsar-manager-release-notes/?$" "/release-notes" [R=301,DPI,L]
+
+<IfModule mod_headers.c>
+ Header set Content-Security-Policy "script-src 'self' widget.kapa.ai
www.google.com https://hcaptcha.com https://*.hcaptcha.com
https://www.gstatic.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self'
proxy.kapa.ai kapa-widget-proxy-la7dkmplpq-uc.a.run.app metrics.kapa.ai
https://hcaptcha.com https://*.hcaptcha.com www.google.com; frame-src 'self'
www.google.com https://hcaptcha.com https://*.hcaptcha.com; style-src 'self'
'unsafe-inline' https://hcaptcha.com https://*.hcaptcha.com;"
+</IfModule>
\ No newline at end of file