Skip to content

Commit

Permalink
Merge pull request #462 from ImmaZoni/search
Browse files Browse the repository at this point in the history
Integrate Algolia Search into Subspace Documentation
  • Loading branch information
EmilFattakhov committed Mar 27, 2024
2 parents e08ae36 + 32c4cc2 commit 1da6c11
Show file tree
Hide file tree
Showing 3 changed files with 3,011 additions and 61 deletions.
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 @@ -385,6 +389,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"
}
}

0 comments on commit 1da6c11

Please sign in to comment.