-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ai chatbot integration with Kapa script
- Loading branch information
Jason I
committed
Oct 11, 2023
1 parent
c44d901
commit d7ff336
Showing
3 changed files
with
36 additions
and
3 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,6 @@ | ||
import { useLocation } from "@docusaurus/router"; | ||
|
||
export function useIsDocs() { | ||
const location = useLocation(); | ||
return location.pathname.startsWith("/docs/"); | ||
} |
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
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,26 @@ | ||
import React from "react"; | ||
import Head from "@docusaurus/Head"; | ||
import { useIsDocs } from "@site/src/hooks/useIsDocs"; | ||
|
||
export default function Root({ children }) { | ||
const isDocsPage = useIsDocs(); | ||
|
||
return ( | ||
<> | ||
{isDocsPage && ( | ||
// AI Chatbot Integration via Kapa | ||
<Head> | ||
<script | ||
defer | ||
src="https://widget.kapa.ai/kapa-widget.bundle.js" | ||
data-website-id="08910249-851f-465b-b60f-238d84e1afc1" | ||
data-project-name="Internet Computer" | ||
data-project-color="#172234" | ||
data-project-logo="https://s3.coinmarketcap.com/static-gravity/image/2fb1bc84c1494178beef0822179d137d.png" | ||
/> | ||
</Head> | ||
)} | ||
{children} | ||
</> | ||
); | ||
} |