This is an automated email from the ASF dual-hosted git repository.
critas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git
The following commit(s) were added to refs/heads/main by this push:
new 75dd531f Add Kapa AI widget configuration to support multi-language
and user consent functionality. (#967)
75dd531f is described below
commit 75dd531fd6835fb8bfa30097fba5c8ce0982be44
Author: CritasWang <[email protected]>
AuthorDate: Fri Jan 16 12:01:52 2026 +0800
Add Kapa AI widget configuration to support multi-language and user consent
functionality. (#967)
---
src/.vuepress/config.ts | 85 ++++++++++++++++++++++++++++---------------------
1 file changed, 48 insertions(+), 37 deletions(-)
diff --git a/src/.vuepress/config.ts b/src/.vuepress/config.ts
index c65c3a8e..a547e93c 100644
--- a/src/.vuepress/config.ts
+++ b/src/.vuepress/config.ts
@@ -23,6 +23,40 @@ import theme from './theme.js';
const dirname = getDirname(import.meta.url);
+const kapaConfig = {
+ async: true,
+ src: 'https://widget.kapa.ai/kapa-widget.bundle.js',
+ 'data-website-id': '2d37bfdd-8d98-40ba-9223-9d4f81bfb327',
+ // 'data-language': 'zh',
+ 'data-project-name': 'Apache IoTDB',
+ 'data-project-color': '#FFFFFF',
+ 'data-button-z-index': '1999',
+ 'data-button-padding': '4px',
+ 'data-button-border-radius': '4px',
+ 'data-button-image-height': '24px',
+ 'data-button-image-width': '20px',
+ 'data-button-text-color': '#9E2878',
+ 'data-project-logo': 'https://iotdb.apache.org/img/logo.svg',
+ 'data-button-position-right': '16px',
+ 'data-button-position-bottom': '8px',
+ 'data-button-height': '56px',
+ 'data-button-width': '48px',
+ 'data-button-text': 'Ask',
+ 'data-modal-override-open-selector': '#custom-ask-ai-button',
+ 'data-modal-image-width': '150px',
+ 'data-modal-title': 'AI Docs',
+ 'data-modal-title-color': '#9E2878',
+ 'data-deep-thinking-button-active-bg-color': '#F6F7F8',
+ 'data-deep-thinking-button-active-text-color': '#9E2878',
+ 'data-deep-thinking-button-active-hover-text-color': '#9E2878',
+ 'data-modal-disclaimer':
+ 'This is a custom LLM for Apache IoTDB with access to all
[documentation](iotdb.apache.org/docs/), [GitHub Open Issues, PRs and
READMEs](github.com/apache/iotdb). Companies deploy assistants like
this ([built by kapa.ai](https://kapa.ai)) on docs via [website
widget](https://docs.kapa.ai/integrations/website-widget) (Docker, Reddit), in
[support forms](https://docs.kapa.ai/integrations/support-form-deflector) for
ticket deflection (Monday.com, Mapbox), or as [Slack bots](htt [...]
+ 'data-user-analytics-fingerprint-enabled': 'true',
+ '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](https://www.kapa.ai/content/privacy-policy). This service uses
reCAPTCHA, which requires your consent to Google's [Privacy
Policy](https://policies.google.com/privacy) and [Terms of
Service](https://policies.google.com/terms). By proceeding, you explicitly
agree to both kapa.ai's and Google's privacy policies.",
+};
+
export default defineUserConfig({
base: '/',
@@ -31,11 +65,25 @@ export default defineUserConfig({
lang: 'en-US',
title: 'IoTDB Website',
description: 'Apache IoTDB',
+ head: [['script', { ...kapaConfig }]],
},
'/zh/': {
lang: 'zh-CN',
title: 'IoTDB Website',
description: 'Apache IoTDB',
+ head: [
+ [
+ 'script',
+ {
+ ...kapaConfig,
+ 'data-language': 'zh',
+ 'data-modal-disclaimer':
+ '这是一个针对 Apache IoTDB
的定制化大型语言模型,能够访问所有[文档](iotdb.apache.org/docs/)、[GitHub 公开问题、PR
和自述文件](github.com/apache/iotdb)。 许多公司通过 [kapa.ai 构建](https://kapa.ai)
的助手部署在文档上,方式包括通过[网站小部件](https://docs.kapa.ai/integrations/website-widget)(Docker、Reddit)、在[支持表单](https://docs.kapa.ai/integrations/support-form-deflector)中进行工单偏转(Monday.com、Mapbox),或作为具有私有源的[Slack
机器人](https://docs.kapa.ai/integrations/slack-bot)。',
+ 'data-consent-screen-disclaimer':
+ "点击<I agree, let's chat>即表示您同意按照 kapa.ai
的[隐私政策](https://www.kapa.ai/content/privacy-policy)使用 AI 助手。本服务使用
reCAPTCHA,您需要同意 Google
的[隐私政策](https://policies.google.com/privacy)和[服务条款](https://policies.google.com/terms)。继续操作即表示您明确同意
kapa.ai 和 Google 的隐私政策。",
+ },
+ ],
+ ],
},
},
@@ -84,43 +132,6 @@ _paq.push(['enableLinkTracking']);
})();
`,
],
- [
- 'script',
- {
- async: true,
- src: 'https://widget.kapa.ai/kapa-widget.bundle.js',
- 'data-website-id': '2d37bfdd-8d98-40ba-9223-9d4f81bfb327',
- // 'data-language': 'zh',
- 'data-project-name': 'Apache IoTDB',
- 'data-project-color': '#FFFFFF',
- 'data-button-z-index': '1999',
- 'data-button-padding': '4px',
- 'data-button-border-radius': '4px',
- 'data-button-image-height': '24px',
- 'data-button-image-width': '20px',
- 'data-button-text-color': '#9E2878',
- 'data-project-logo': 'https://iotdb.apache.org/img/logo.svg',
- 'data-button-position-right': '16px',
- 'data-button-position-bottom': '8px',
- 'data-button-height': '56px',
- 'data-button-width': '48px',
- 'data-button-text': 'Ask',
- // 'data-button-hide': 'true',
- 'data-modal-override-open-selector': '#custom-ask-ai-button',
- 'data-modal-image-width': '150px',
- 'data-modal-title': 'AI Docs',
- 'data-modal-title-color': '#9E2878',
- 'data-modal-disclaimer':
- 'This is a custom LLM for Apache IoTDB with access to all
[documentation](iotdb.apache.org/docs/), [GitHub Open Issues, PRs and
READMEs](github.com/apache/iotdb). Companies deploy assistants like
this ([built by kapa.ai](https://kapa.ai)) on docs via [website
widget](https://docs.kapa.ai/integrations/website-widget) (Docker, Reddit), in
[support forms](https://docs.kapa.ai/integrations/support-form-deflector) for
ticket deflection (Monday.com, Mapbox), or as [Slack bot [...]
-
- // 'data-modal-example-questions':
- // 'How do I get started?,How to add example questions?',
- 'data-user-analytics-fingerprint-enabled': 'true',
- '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](https://www.kapa.ai/content/privacy-policy). This service uses
reCAPTCHA, which requires your consent to Google's [Privacy
Policy](https://policies.google.com/privacy) and [Terms of
Service](https://policies.google.com/terms). By proceeding, you explicitly
agree to both kapa.ai's and Google's privacy policies.",
- },
- ],
],
shouldPrefetch: false,