Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Algolia Search into Subspace Documentation #462

Merged
merged 5 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ const config = {
label: 'GitHub',
position: 'right',
},
{
type: 'search',
position: 'right',
}
],
},
footer: {
Expand Down Expand Up @@ -397,6 +401,33 @@ const config = {
darkTheme: darkCodeTheme,
additionalLanguages: ['toml', 'powershell', 'shell-session', 'ini'],
},
algolia: {
// The application ID provided by Algolia
appId: 'PURWQGSNUR',

// Public API key: it is safe to commit it
apiKey: '3317f8373bc49a240f45964de434250c',

indexName: 'subspace-documentation',

// Optional: see doc section below
contextualSearch: true,

// 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.
//externalUrlRegex: 'external\\.com|domain\\.com',

// 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
//replaceSearchResultPathname: {
// from: '/docs/', // or as RegExp: /\/docs\//
// to: '/',
//},

// Optional: Algolia search parameters
searchParameters: {},

// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: false,
}
}),
};

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@docusaurus/plugin-google-gtag": "^2.4.3",
"@docusaurus/plugin-sitemap": "^2.4.3",
"@docusaurus/preset-classic": "^2.4.3",
"@docusaurus/theme-search-algolia": "^3.1.1",
"@mdx-js/react": "^1.6.22",
"axios": "^1.5.0",
"clsx": "^1.2.1",
Expand Down Expand Up @@ -54,6 +55,6 @@
]
},
"engines": {
"node": ">=16.14"
"node": ">=18.0"
}
}