Update Docs extra.js (#16663)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
0ae9ee897f
commit
9030a2d7ba
2 changed files with 88 additions and 0 deletions
|
|
@ -67,3 +67,85 @@ window.onhashchange = function() {
|
|||
hash: window.location.pathname + window.location.search + window.location.hash
|
||||
}, '*');
|
||||
};
|
||||
|
||||
// Add Inkeep button
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const inkeepScript = document.createElement("script");
|
||||
inkeepScript.src = "https://unpkg.com/@inkeep/uikit-js@0.3.11/dist/embed.js";
|
||||
inkeepScript.type = "module";
|
||||
inkeepScript.defer = true;
|
||||
document.head.appendChild(inkeepScript);
|
||||
|
||||
// Configure and initialize the widget
|
||||
const addInkeepWidget = () => {
|
||||
const inkeepWidget = Inkeep().embed({
|
||||
componentType: "ChatButton",
|
||||
colorModeSync: {
|
||||
observedElement: document.documentElement,
|
||||
isDarkModeCallback: (el) => {
|
||||
const currentTheme = el.getAttribute("data-color-mode");
|
||||
return currentTheme === "dark";
|
||||
},
|
||||
colorModeAttribute: "data-color-mode",
|
||||
},
|
||||
properties: {
|
||||
chatButtonType: "PILL",
|
||||
fixedPositionYOffset: "2rem",
|
||||
chatButtonBgColor: "#F3F3F3",
|
||||
baseSettings: {
|
||||
apiKey: "13dfec2e75982bc9bae3199a08e13b86b5fbacd64e9b2f89", // required
|
||||
integrationId: "cm1shscmm00y26sj83lgxzvkw", // required
|
||||
organizationId: "org_e3869az6hQZ0mXdF", // required
|
||||
primaryBrandColor: "#111F68", // Ultralytics brand color
|
||||
organizationDisplayName: "Ultralytics",
|
||||
theme: {
|
||||
stylesheetUrls: ["../stylesheets/style.css"],
|
||||
},
|
||||
// ...optional settings
|
||||
},
|
||||
modalSettings: {
|
||||
// optional settings
|
||||
},
|
||||
searchSettings: {
|
||||
// optional settings
|
||||
},
|
||||
aiChatSettings: {
|
||||
chatSubjectName: "Ultralytics",
|
||||
botAvatarSrcUrl: "https://storage.googleapis.com/organization-image-assets/ultralytics-botAvatarSrcUrl-1727908259285.png",
|
||||
botAvatarDarkSrcUrl: "https://storage.googleapis.com/organization-image-assets/ultralytics-botAvatarDarkSrcUrl-1727908258478.png",
|
||||
quickQuestions: [
|
||||
"What's new in Ultralytics YOLO11?",
|
||||
"How can I get started with Ultralytics HUB?",
|
||||
"How does Ultralytics Enterprise Licensing work?"
|
||||
],
|
||||
getHelpCallToActions: [
|
||||
{
|
||||
name: "Ask on Ultralytics GitHub",
|
||||
url: "https://github.com/ultralytics/ultralytics",
|
||||
icon: {
|
||||
builtIn: "FaGithub"
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Ask on Ultralytics Discourse",
|
||||
url: "https://community.ultralytics.com/",
|
||||
icon: {
|
||||
builtIn: "FaDiscourse"
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Ask on Ultralytics Discord",
|
||||
url: "https://discord.com/invite/ultralytics",
|
||||
icon: {
|
||||
builtIn: "FaDiscord"
|
||||
}
|
||||
}
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
inkeepScript.addEventListener("load", () => {
|
||||
addInkeepWidget(); // initialize the widget
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue