Skip to content

Commit

Permalink
feat(docusaurus): add algolia docsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
chartrandf committed Nov 27, 2024
1 parent 1fe29a6 commit c9b5e75
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions website/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALGOLIA_APP_ID="XYZ"
ALGOLIA_API_KEY="XYZ"
ALGOLIA_INDEX_NAME="beta-wazo-platform"
1 change: 1 addition & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
10 changes: 10 additions & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';
import 'dotenv/config';
import REDIRECTS from './redirects';

const config: Config = {
Expand Down Expand Up @@ -146,6 +147,15 @@ const config: Config = {
mermaid: {
theme: { light: 'neutral', dark: 'dark' },
},
...(
process.env.ALGOLIA_APP_ID ? {
algolia: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
}
} : {}
)
} satisfies Preset.ThemeConfig,
plugins: [
[
Expand Down
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@iconify/react": "^5.0.2",
"@mdx-js/react": "^3.1.0",
"clsx": "^2.1.1",
"dotenv": "^16.4.5",
"prism-react-renderer": "^2.4.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
8 changes: 8 additions & 0 deletions website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7749,6 +7749,13 @@ __metadata:
languageName: node
linkType: hard

"dotenv@npm:^16.4.5":
version: 16.4.5
resolution: "dotenv@npm:16.4.5"
checksum: 10c0/48d92870076832af0418b13acd6e5a5a3e83bb00df690d9812e94b24aff62b88ade955ac99a05501305b8dc8f1b0ee7638b18493deb6fe93d680e5220936292f
languageName: node
linkType: hard

"duplexer@npm:^0.1.2":
version: 0.1.2
resolution: "duplexer@npm:0.1.2"
Expand Down Expand Up @@ -14955,6 +14962,7 @@ __metadata:
"@lottiefiles/react-lottie-player": "npm:^3.5.4"
"@mdx-js/react": "npm:^3.1.0"
clsx: "npm:^2.1.1"
dotenv: "npm:^16.4.5"
prism-react-renderer: "npm:^2.4.0"
react: "npm:^18.3.1"
react-dom: "npm:^18.3.1"
Expand Down

0 comments on commit c9b5e75

Please sign in to comment.