-
Notifications
You must be signed in to change notification settings - Fork 99
Updated website search by integrating kapa.ai search functionality #896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,3 +106,8 @@ img[src='/search.png'] { | |
| display: inline-flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| /* Hide VitePress local search modal to use kapa.ai search instead */ | ||
| .VPLocalSearchBox { | ||
| display: none !important; | ||
| } | ||
|
Comment on lines
+110
to
+113
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep a fallback when the external search widget is unavailable. This hides the built-in search modal before the kapa.ai widget proves it loaded. If the third-party script is blocked, slow, or down, the navbar search trigger and Cmd/Ctrl-K end up pointing at a hidden UI and search disappears entirely. Hide 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: gardener/documentation
Length of output: 1721
🏁 Script executed:
Repository: gardener/documentation
Length of output: 1299
🏁 Script executed:
# Check if there are any PR descriptions or commit messages that explain the search behavior git log --oneline -20 -- .vitepress/config.mtsRepository: gardener/documentation
Length of output: 108
🌐 Web query:
kapa.ai widget data-consent-required integrated search mode behavior documentation💡 Result:
data-consent-required(Kapa website widget)data-consent-required="true"to require a consent screen before a user can chat. When enabled, the widget sets akapa_consentcookie in the user’s browser. You can also customize the consent screen title/disclaimer and accept/reject button text via thedata-consent-screen-*parameters. [1]“Integrated search mode” behavior (Kapa website widget)
data-search-mode-enabled="true"adds a Search tab/mode so users can toggle between AI chat and search inside the widget. [2]data-search-mode-default="true"opens the widget directly in search mode (instead of Ask AI). [1], [2]data-modal-override-open-selector-search="<css selector>"to bind an existing “Search” UI element (button/search bar) so it opens the Kapa widget in search mode. [1], [2]data-modal-open-on-command-k="true"plusdata-modal-command-k-search-mode-default="true"opens the widget with Cmd/Ctrl+K directly into search mode. [1], [2]window.Kapa.open({ mode: "search" })(optionally withquery) opens the widget directly in search mode. [2]Sources
[1] Kapa Docs — Website Widget: Configuration (consent + search parameters) (docs.kapa.ai)
[2] Kapa Docs — Website Widget: Search Mode feature (docs.kapa.ai)
[3] Kapa Docs — Website Widget: FAQ (search mode / overriding existing search trigger) (docs.kapa.ai)
Citations:
🌐 Web query:
kapa.ai search widget consent configuration how it works💡 Result:
To require end-user consent in the kapa.ai Website Widget (including when you use it as a “search widget” by enabling Search mode), you configure it via
data-*attributes on the widget<script>tag. [1] (docs.kapa.ai)How the consent configuration works
data-consent-required="true". When enabled, the widget will show a consent screen and, upon acceptance, it sets a browser cookie namedkapa_consentto remember the choice. [1] (docs.kapa.ai)data-consent-screen-titledata-consent-screen-disclaimerdata-consent-screen-accept-button-textdata-consent-screen-reject-button-text[1] (docs.kapa.ai)Minimal example
If you tell me which consent tool you use (Cookiebot, OneTrust, etc.), I can suggest the typical pattern for only calling
window.Kapa.render()after consent (usingdata-render-on-load="false"). [1] (docs.kapa.ai)Citations:
Integrated search is still gated by consent requirement.
Line 301 keeps
data-consent-required: 'true', which blocks access to the entire widget (including search mode) until the user accepts the consent screen. Even though lines 308–309 configure Cmd/Ctrl+K to open directly in search mode, the consent screen still appears first. Per the kapa.ai widget documentation,data-consent-requiredapplies to all widget functionality. If the PR goal is to let users access search without consent, removedata-consent-requiredor set it to'false'to allow search to function freely while optionally gating only the AI assistant features.🤖 Prompt for AI Agents