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

feat: add algolia search to docs #445

Merged
merged 2 commits into from
Jan 3, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 33 additions & 18 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ const config = {
],
},
gtag: {
trackingID: 'G-VX9XQWCCC5',
anonymizeIP: true
trackingID: "G-VX9XQWCCC5",
anonymizeIP: true,
},
googleTagManager: {
containerId: 'GTM-NSJLJ9D5',
containerId: "GTM-NSJLJ9D5",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
Expand Down Expand Up @@ -307,6 +307,35 @@ const config = {
disableSwitch: true,
respectPrefersColorScheme: false,
},
// Docusaurus x Algolia documentation: https://docusaurus.io/docs/search#connecting-algolia
algolia: {
appId: "AO8XE1SP27",

// Public API key (safe to commit)
apiKey: "c9e55704810dd96a5013d44fb439186b",

indexName: "BOB Docs",
contextualSearch: true,

// 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: "localhost:3000",
to: "docs.gobob.xyz",
},

// Optional: path for dedicated search page (`false` to disable it)
searchPagePath: "search",

// Collect data on user events, such as search queries
insights: true,

// Other parameters: https://www.algolia.com/doc/api-reference/search-api-parameters/
searchParameters: {},

// Other options: https://docsearch.algolia.com/docs/api/
},
// announcementBar: {
// id: "sign_up",
// content:
Expand All @@ -320,21 +349,7 @@ const config = {
markdown: {
mermaid: true,
},
themes: [
"@docusaurus/theme-mermaid",
[
"@easyops-cn/docusaurus-search-local",
{
indexBlog: false,
indexDocs: true,
indexPages: false,
hashed: true,
highlightSearchTermsOnTargetPage: true,
language: ["en"],
},
],
"docusaurus-theme-github-codeblock",
],
themes: ["@docusaurus/theme-mermaid", "docusaurus-theme-github-codeblock"],
scripts: [
{
src: "https://cdn.usefathom.com/script.js",
Expand Down
3 changes: 2 additions & 1 deletion docs/static/robots.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
User-agent: *
Disallow:
Disallow:
# Algolia-Crawler-Verif: 6861211C3ECA4619
Loading