diff --git a/assets/icons/ai.svg b/assets/icons/ai.svg new file mode 100644 index 0000000..60e1dcd --- /dev/null +++ b/assets/icons/ai.svg @@ -0,0 +1,12 @@ + diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index 76b0e88..79a9e80 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -31,6 +31,7 @@ @import "404"; @import "skip-links"; @import "heading-anchor"; +@import "ask-ai-button"; @import "theme-switcher"; @import "dark-theme"; @import "cta-banner"; diff --git a/assets/scss/ask-ai-button.scss b/assets/scss/ask-ai-button.scss new file mode 100644 index 0000000..4c6bc83 --- /dev/null +++ b/assets/scss/ask-ai-button.scss @@ -0,0 +1,45 @@ +// (C) 2026 GoodData Corporation +@import "variables/variables"; + +// "Ask AI" button — opens the Kapa AI widget. The outlined button appearance +// comes from the shared .gd-docs-header-nav__secondary styles; this file only +// owns the container layout and icon sizing. Rendered only when +// Site.Params.askAI.websiteId is configured (see partials/ask-ai-button.html). +.ask-ai-button-container { + display: flex; + margin-left: 20px; + justify-content: flex-start; + + button { + display: flex; + align-items: center; + gap: 5px; + + &:disabled { + cursor: not-allowed; + opacity: 0.2; + + &:hover, + &:focus, + &:active { + color: inherit; + border-color: inherit; + } + + &:focus { + box-shadow: inherit; + } + } + } + + .ask-ai-icon { + display: flex; + width: fit-content; + + svg { + width: 15px; + height: 15px; + margin: 0; + } + } +} diff --git a/layouts/partials/ask-ai-button.html b/layouts/partials/ask-ai-button.html new file mode 100644 index 0000000..c5d1645 --- /dev/null +++ b/layouts/partials/ask-ai-button.html @@ -0,0 +1,22 @@ +{{/* (C) 2026 GoodData Corporation */}} +{{/* "Ask AI" button — opens the Kapa AI widget (loaded by ask-ai-widget.html). + Rendered only when Site.Params.askAI.websiteId is configured. The widget is + triggered via the `open-kapa-widget` override class. */}} +{{- with .Site.Params.askAI }} +{{- if .websiteId }} +
+{{- end }} +{{- end }} diff --git a/layouts/partials/ask-ai-widget.html b/layouts/partials/ask-ai-widget.html new file mode 100644 index 0000000..08281df --- /dev/null +++ b/layouts/partials/ask-ai-widget.html @@ -0,0 +1,34 @@ +{{/* (C) 2026 GoodData Corporation */}} +{{/* Loads the Kapa AI widget bundle. Rendered only when Site.Params.askAI.websiteId + is configured. Pair with partials/ask-ai-button.html, which provides the + trigger button (data-button-hide keeps Kapa's own launcher hidden). + + Configure in site params, e.g.: + [params.askAI] + websiteId = "..." # required + projectName = "GoodData" + projectColor = "#ED26B7" + projectLogo = "https://www.gooddata.ai/img/generic/logo-g.svg" + modalDisclaimerTextColor = "#ED26B7" + modalTitleColor = "#1c0d3f" + modalTitleFontFamily = "bca6d3310b5c9dae1dae416e8abc8405,helvetica,arial,sans-serif" +*/}} +{{- with .Site.Params.askAI }} +{{- if .websiteId }} + +{{- end }} +{{- end }} diff --git a/layouts/partials/hooks/body-end.html b/layouts/partials/hooks/body-end.html index a1be57b..dd22163 100644 --- a/layouts/partials/hooks/body-end.html +++ b/layouts/partials/hooks/body-end.html @@ -11,3 +11,4 @@ {{ $themeSwitcherJS := resources.Get "js/theme-switcher.js" | minify | fingerprint }} +{{ partial "ask-ai-widget.html" . }} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 0abf86a..50f8638 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -28,6 +28,7 @@ {{ end }} + {{ partial "ask-ai-button.html" . }} {{ if .Site.Params.versions }}