-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add Ask AI button with Gurubase widget (#2042)
* docs: add Ask AI button with Gurubase widget * docs: generate API References * chore: ignore Gurubase token
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
document.addEventListener("DOMContentLoaded", () => { | ||
const guruScript = document.createElement("script"); | ||
guruScript.src = "https://widget.gurubase.io/widget.latest.min.js"; | ||
guruScript.defer = true; | ||
guruScript.id = "guru-widget-id"; | ||
|
||
const widgetSettings = { | ||
// This token is binded to `faststream.airt.ai` domain, | ||
// so its publication is not a problem | ||
"data-widget-id": "TSM1_f2Ese6iwdKflPk7_ItbjXoRBi5CxL_BEYM2s_4", // pragma: allowlist secrets | ||
"data-text": "Ask AI", | ||
"data-margins": JSON.stringify({ bottom: "20px", right: "20px" }), | ||
"data-light-mode": "false", | ||
"data-bg-color": "#003257", | ||
"data-icon-url": "https://faststream.airt.ai/latest/assets/img/logo.svg", | ||
}; | ||
|
||
Object.entries(widgetSettings).forEach(([key, value]) => { | ||
guruScript.setAttribute(key, value); | ||
}); | ||
|
||
document.body.appendChild(guruScript); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters