Skip to content

Commit

Permalink
feat: move search to Orama Cloud (#511)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas De Morais <[email protected]>
  • Loading branch information
lucacasonato and raiindev authored Jun 24, 2024
1 parent 51507c8 commit 4c6c297
Show file tree
Hide file tree
Showing 7 changed files with 15,849 additions and 9,019 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- name: Build step
env:
DENO_FUTURE: 1
ORAMA_CLOUD_INDEX_ID: ${{ vars.ORAMA_CLOUD_INDEX_ID }}
ORAMA_CLOUD_API_KEY: ${{ secrets.ORAMA_CLOUD_API_KEY }}
run: npm install && deno task build

- name: Upload to Deno Deploy
Expand Down
5 changes: 4 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"unstable": ["fs"]
"lock": false,
"unstable": [
"kv"
]
}
95 changes: 95 additions & 0 deletions deno.lock

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

52 changes: 14 additions & 38 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const process = require("node:process");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const findReplace = require("./src/remark/find_replace");
const lightCodeTheme = require("prism-react-renderer/themes/github");
Expand Down Expand Up @@ -53,6 +54,19 @@ const config = {
},
],
*/
[
"@orama/plugin-docusaurus-v3",
{
...(process.env.ORAMA_CLOUD_API_KEY !== undefined
? {
cloud: {
indexId: process.env.ORAMA_CLOUD_INDEX_ID,
oramaCloudAPIKey: process.env.ORAMA_CLOUD_API_KEY,
},
}
: {}),
},
],
[
"@docusaurus/plugin-content-docs",
{
Expand Down Expand Up @@ -269,44 +283,6 @@ const config = {
darkTheme: darkCodeTheme,
additionalLanguages: ["powershell", "diff"],
},
algolia: {
// The application ID provided by Algolia
appId: "KAQ4QIALEB",

// Public API key: it is safe to commit it
apiKey: "0795dfc12048ff344a54bb4c04c9000b",

indexName: "deno",

insights: true,

// 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: "search",
},
}),
};

Expand Down
Loading

0 comments on commit 4c6c297

Please sign in to comment.