Skip to content

Commit

Permalink
feat: add Algolia DocSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
IanKrieger committed Jun 14, 2024
1 parent 5f4a554 commit 94b2f8e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:

- name: Build website
run: npm run build
env:
REACT_APP_DOC_SEARCH_APP_ID: ${{ secrets.DOC_SEARCH_APP_ID }}
REACT_APP_DOC_SEARCH_INDEX_NAME: ${{ secrets.DOC_SEARCH_INDEX_NAME }}

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
Expand Down
9 changes: 9 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import * as process from "node:process";

const config: Config = {
title: 'Brave Ads',
Expand Down Expand Up @@ -102,6 +103,14 @@ const config: Config = {
],
copyright: `Copyright © ${new Date().getFullYear()} Brave Software, Inc.`,
},
algolia: {
appId: process.env.REACT_APP_DOC_SEARCH_APP_ID,
// Public API key: it is safe to commit it
apiKey: '9d6bcc3afa8daed9395db8c441bc04a1',
indexName: process.env.REACT_APP_DOC_SEARCH_INDEX_NAME,
// Ensures that search results are relevant to the current language and version
contextualSearch: true,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
Expand Down
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 94b2f8e

Please sign in to comment.