Skip to content

Commit

Permalink
feat: Cookbook Onboard integration
Browse files Browse the repository at this point in the history
fixup of prev commit

fix
  • Loading branch information
ClockRide committed Jul 30, 2024
1 parent c7f3925 commit 4cc7834
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions src/components/AskCookbook.astro
Original file line number Diff line number Diff line change
@@ -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"
---

<!-- Cookbook Onboard (AI Assistant). -->
<AskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} client:only="react" />
2 changes: 2 additions & 0 deletions src/layouts/HomeLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,5 +88,6 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site)
<slot />
</main>
<Footer />
<AskCookbook />
</body>
</html>
2 changes: 2 additions & 0 deletions src/layouts/MainLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as CONFIG from "../config"
import Footer from "~/components/Footer/Footer.astro"
import { changeLanguage } from "i18next"
import { ViewTransitions } from "astro:transitions"
import AskCookbook from "~/components/AskCookbook.astro"
const { content = {}, frontmatter } = Astro.props
// Astro.props?.headings is for .mdx pages, Astro.props?.content?.astro.headings is for .md pages
Expand Down Expand Up @@ -248,5 +249,6 @@ changeLanguage(content.lang)
import("../scripts/link-to-wallet.ts")
}
</script> -->
<AskCookbook />
</body>
</html>

0 comments on commit 4cc7834

Please sign in to comment.