From 4cc783465703fd979d4df4cda1d4508e9741099f Mon Sep 17 00:00:00 2001 From: Anton Dosta Date: Mon, 29 Jul 2024 02:47:14 -0700 Subject: [PATCH] feat: Cookbook Onboard integration fixup of prev commit fix --- package.json | 1 + src/components/AskCookbook.astro | 10 ++++++++++ src/layouts/HomeLayout.astro | 2 ++ src/layouts/MainLayout.astro | 2 ++ 4 files changed, 15 insertions(+) create mode 100644 src/components/AskCookbook.astro diff --git a/package.json b/package.json index baa25c0e..8c994bec 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@astrojs/partytown": "^2.0.4", "@astrojs/prism": "^3.0.0", "@astrojs/tailwind": "^5.1.0", + "@cookbookdev/docsbot": "^4.21.5", "@nanostores/preact": "^0.3.1", "astro-auto-import": "^0.4.2", "astro-expressive-code": "^0.35.3", diff --git a/src/components/AskCookbook.astro b/src/components/AskCookbook.astro new file mode 100644 index 00000000..627d6e9a --- /dev/null +++ b/src/components/AskCookbook.astro @@ -0,0 +1,10 @@ +--- +import AskCookbook from "@cookbookdev/docsbot/react" + +// API key is public so it's fine to just hardcode it here. +const COOKBOOK_PUBLIC_API_KEY = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NjhkNGNkNDQ5ODQ2YjcxMDdjYjY4MDgiLCJpYXQiOjE3MjA1MzYyNzYsImV4cCI6MjAzNjExMjI3Nn0.ZQ6KvZ4lRGTQUyleQFS0okdNOhZI_wsv2v9YFn2t6Pw" +--- + + + diff --git a/src/layouts/HomeLayout.astro b/src/layouts/HomeLayout.astro index e05988ff..d8b1d529 100644 --- a/src/layouts/HomeLayout.astro +++ b/src/layouts/HomeLayout.astro @@ -5,6 +5,7 @@ import Header from "../components/Header/Header.astro" import * as CONFIG from "../config" import Footer from "~/components/Footer/Footer.astro" import LeftSidebar from "../components/LeftSidebar/LeftSidebar.astro" +import AskCookbook from "~/components/AskCookbook.astro" const { content = {} } = Astro.props const currentPage = new URL(Astro.request.url).pathname @@ -87,5 +88,6 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site)