Skip to content
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

feat(docs): Cookbook integration #8083

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"rewrite": "node ./scripts/rewrite_paths.js"
},
"dependencies": {
"@cookbookdev/docsbot": "^4.21.12",
"@docusaurus/core": "^3.0.1",
"@docusaurus/plugin-ideal-image": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
Expand Down
5 changes: 5 additions & 0 deletions docs/src/theme/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ import React from 'react';
import useMatomo from '@site/src/components/Matomo/matomo';
import BrowserOnly from '@docusaurus/BrowserOnly';
import useIsBrowser from '@docusaurus/useIsBrowser';
import AskCookbook from '@cookbookdev/docsbot/react';

function OptOutForm() {
const banner = useMatomo();

return <>{banner}</>;
}

/** It's a public API key, so it's safe to expose it here. */
const COOKBOOK_PUBLIC_API_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NmIyOWRmZDM3ZWIwYzRiMTVlZGYzMDAiLCJpYXQiOjE3MjI5ODE4ODUsImV4cCI6MjAzODU1Nzg4NX0.19rsZIFNmgVEbpmDjEJ8oPnL7uHYePytf-Ex1pjm2_8';

export default function Root({ children }) {
const useIsBrowserValue = useIsBrowser();
if (!useIsBrowserValue) return <>{children}</>;
Expand All @@ -17,6 +21,7 @@ export default function Root({ children }) {
<>
{children}
<BrowserOnly>{() => <OptOutForm />}</BrowserOnly>
<BrowserOnly>{() => <AskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} />}</BrowserOnly>
</>
);
}
Loading
Loading