Skip to content

Commit 28bd02e

Browse files
committed
Add Algolia search and saucelabs Github Codeblock
Signed-off-by: ward727 <Ward727a@gmail.com>
1 parent 2e654f5 commit 28bd02e

4 files changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Deploy Docusaurus to Namecheap
22

3+
34
on:
45
push:
56
branches:
@@ -8,6 +9,10 @@ on:
89
jobs:
910
build:
1011
runs-on: ubuntu-latest
12+
env:
13+
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
14+
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
15+
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}
1116

1217
steps:
1318
- name: Checkout repository

docusaurus.config.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,40 @@ const config: Config = {
6969
],
7070

7171
themeConfig: {
72+
73+
74+
algolia: {
75+
// The application ID provided by Algolia
76+
appId: process.env.ALGOLIA_APP_ID,
77+
78+
// Public API key: it is safe to commit it
79+
apiKey: process.env.ALGOLIA_API_KEY,
80+
81+
indexName: process.env.ALGOLIA_INDEX_NAME,
82+
83+
// Optional: see doc section below
84+
contextualSearch: true,
85+
86+
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
87+
externalUrlRegex: 'external\\.com|domain\\.com',
88+
89+
// Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
90+
replaceSearchResultPathname: {
91+
from: '/docs/', // or as RegExp: /\/docs\//
92+
to: '/',
93+
},
94+
95+
// Optional: Algolia search parameters
96+
searchParameters: {},
97+
98+
// Optional: path for search page that enabled by default (`false` to disable it)
99+
searchPagePath: 'search',
100+
101+
// Optional: whether the insights feature is enabled or not on Docsearch (`false` by default)
102+
insights: false,
103+
104+
//... other Algolia params
105+
},
72106
// Replace with your project's social card
73107
image: 'img/docusaurus-social-card.jpg',
74108
colorMode: {

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@docusaurus/core": "3.9.1",
1919
"@docusaurus/preset-classic": "3.9.1",
2020
"@mdx-js/react": "^3.0.0",
21+
"@saucelabs/theme-github-codeblock": "^0.3.0",
2122
"clsx": "^2.0.0",
2223
"prism-react-renderer": "^2.3.0",
2324
"react": "^19.0.0",

0 commit comments

Comments
 (0)