From 3184b7d79f5aa5ae6ae74d54d06c3193ced6d033 Mon Sep 17 00:00:00 2001 From: Adewale Abati Date: Fri, 24 Jan 2025 23:05:43 +0100 Subject: [PATCH] Add search to docs (#751) --- .../workflows/deploy-docs-and-extensions.yml | 4 +++ documentation/docusaurus.config.ts | 33 +++++++++++++++++++ documentation/package-lock.json | 20 +++++++++++ documentation/package.json | 2 ++ 4 files changed, 59 insertions(+) diff --git a/.github/workflows/deploy-docs-and-extensions.yml b/.github/workflows/deploy-docs-and-extensions.yml index 752d5d9c..a281842e 100644 --- a/.github/workflows/deploy-docs-and-extensions.yml +++ b/.github/workflows/deploy-docs-and-extensions.yml @@ -20,6 +20,10 @@ jobs: - name: Install dependencies and build docs working-directory: ./documentation + env: + INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }} + INKEEP_INTEGRATION_ID: ${{ secrets.INKEEP_INTEGRATION_ID }} + INKEEP_ORG_ID: ${{ secrets.INKEEP_ORG_ID }} run: | npm install npm run build diff --git a/documentation/docusaurus.config.ts b/documentation/docusaurus.config.ts index c89c29e4..952710e9 100644 --- a/documentation/docusaurus.config.ts +++ b/documentation/docusaurus.config.ts @@ -4,6 +4,12 @@ import type * as Preset from "@docusaurus/preset-classic"; // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) +require('dotenv').config(); + +const inkeepApiKey = process.env.INKEEP_API_KEY; +const inkeepIntegrationId = process.env.INKEEP_INTEGRATION_ID; +const inkeepOrgId = process.env.INKEEP_ORG_ID; + const config: Config = { title: "codename goose", tagline: @@ -57,6 +63,7 @@ const config: Config = { ], ], + themes: ["@inkeep/docusaurus/chatButton", "@inkeep/docusaurus/searchBar"], themeConfig: { // Replace with your project's social card image: "img/home-banner.png", @@ -153,7 +160,33 @@ const config: Config = { theme: prismThemes.github, darkTheme: prismThemes.nightOwl, }, + inkeepConfig: { + baseSettings: { + apiKey: "inkeepApiKey", + integrationId: "inkeepIntegrationId", + organizationId: "inkeepOrgId", + primaryBrandColor: "#1E1E1E" + }, + aiChatSettings: { + chatSubjectName: "goose", + botAvatarSrcUrl: "https://storage.googleapis.com/organization-image-assets/block-botAvatarSrcUrl-1737745528096.png", + botAvatarDarkSrcUrl: "https://storage.googleapis.com/organization-image-assets/block-botAvatarDarkSrcUrl-1737745527450.png", + getHelpCallToActions: [ + { + name: "GitHub", + url: "https://github.com/block/goose", + icon: { + builtIn: "FaGithub" + } + } + ], + quickQuestions: [ + "What is Goose?" + ] + } + }, } satisfies Preset.ThemeConfig, + }; export default config; diff --git a/documentation/package-lock.json b/documentation/package-lock.json index 24be1c56..a12de42d 100644 --- a/documentation/package-lock.json +++ b/documentation/package-lock.json @@ -10,8 +10,10 @@ "dependencies": { "@docusaurus/core": "3.7.0", "@docusaurus/preset-classic": "3.7.0", + "@inkeep/docusaurus": "^2.0.16", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", + "dotenv": "^16.4.7", "prism-react-renderer": "^2.3.0", "react": "^19.0.0", "react-dom": "^19.0.0" @@ -3810,6 +3812,12 @@ "@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==", + "license": "MIT" + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -7191,6 +7199,18 @@ "node": ">=8" } }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", diff --git a/documentation/package.json b/documentation/package.json index 9f3b9210..1685c548 100644 --- a/documentation/package.json +++ b/documentation/package.json @@ -17,8 +17,10 @@ "dependencies": { "@docusaurus/core": "3.7.0", "@docusaurus/preset-classic": "3.7.0", + "@inkeep/docusaurus": "^2.0.16", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", + "dotenv": "^16.4.7", "prism-react-renderer": "^2.3.0", "react": "^19.0.0", "react-dom": "^19.0.0"