From 598a1a0e54626ee9a3f0cc4f4f21c2b6f5a96d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Wed, 4 Dec 2024 08:35:06 +0100 Subject: [PATCH] add ai chat --- .github/workflows/deploy.yaml | 5 ++++- docusaurus.config.js | 24 ++++++++++++++++++++++++ package-lock.json | 6 ++++++ package.json | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 312a51b6cd8..d4653010080 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -34,7 +34,10 @@ jobs: - name: Build website run: npm run build - + env: + INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} + INKEEP_INTEGRATION_ID: ${{ secrets.INKEEP_INTEGRATION_ID }} + INKEEP_ORGANIZATION_ID: ${{ secrets.INKEEP_ORGANIZATION_ID }} # Popular action to deploy to GitHub Pages: # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus - name: Deploy to GitHub Pages (on master) diff --git a/docusaurus.config.js b/docusaurus.config.js index 640cc77987c..50f4823b759 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -184,6 +184,7 @@ const config = { }), ], ], + themes: ["@inkeep/docusaurus/chatButton"], themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ @@ -321,6 +322,29 @@ const config = { darkTheme: darkCodeTheme, additionalLanguages: ['json', 'diff'], }, + inkeepConfig: { + chatButtonType: 'icon', // RECTANGLE_SHORTCUT, ICON, or PILL + baseSettings: { + // see https://docusaurus.io/docs/deployment#using-environment-variables to use docusaurus environment variables + apiKey: process.env.INKEEP_API_KEY, // required + integrationId: process.env.INKEEP_INTEGRATION_ID, // required + organizationId: process.env.INKEEP_ORGANIZATION_ID, // required + primaryBrandColor: "#00acd7", // required -- your brand color, the widget color scheme is derived from this + organizationDisplayName: "GoFiber", + theme: { + // stylesheetUrls: ['/path/to/stylesheets'], // optional + syntaxHighlighter: { + lightTheme: lightCodeTheme, // optional -- pass in the Prism theme you're using + darkTheme: darkCodeTheme, // optional -- pass in the Prism theme you're using + }, + } + }, + aiChatSettings: { + // optional settings + botAvatarSrcUrl: "img/logo.svg", // optional -- use your own bot avatar + botAvatarDarkSrcUrl: "img/logo-dark.svg", // optional -- use your own bot avatar + }, + }, }), }; diff --git a/package-lock.json b/package-lock.json index a3b332c2aca..c5cb7570404 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@docusaurus/plugin-pwa": "^3.6.3", "@docusaurus/preset-classic": "^3.6.3", "@easyops-cn/docusaurus-search-local": "^0.46.1", + "@inkeep/docusaurus": "^2.0.16", "@mdx-js/react": "^3.0.1", "clsx": "^2.1.1", "prism-react-renderer": "^2.3.1", @@ -4069,6 +4070,11 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@inkeep/docusaurus": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/@inkeep/docusaurus/-/docusaurus-2.0.16.tgz", + "integrity": "sha512-dQhjlvFnl3CVr0gWeJ/V/qLnDy1XYrCfkdVSa2D3gJTxI9/vOf9639Y1aPxTxO88DiXuW9CertLrZLB6SoJ2yg==" + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", diff --git a/package.json b/package.json index d2317477c5d..5023dbc041e 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@docusaurus/plugin-pwa": "^3.6.3", "@docusaurus/preset-classic": "^3.6.3", "@easyops-cn/docusaurus-search-local": "^0.46.1", + "@inkeep/docusaurus": "^2.0.16", "@mdx-js/react": "^3.0.1", "clsx": "^2.1.1", "prism-react-renderer": "^2.3.1",