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: move search to Orama Cloud #412

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Expand Up @@ -30,6 +30,8 @@ jobs:
- name: Build step
env:
DENO_FUTURE: 1
ORAMA_CLOUD_INDEX_ID: ${{ env.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
51 changes: 12 additions & 39 deletions docusaurus.config.js
@@ -1,3 +1,4 @@
import process from "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 @@ -77,6 +78,16 @@ const config = {
],
},
],
[
"@orama/plugin-docusaurus-v3",
{
cloud: {
indexId: process.env.ORAMA_CLOUD_INDEX_ID,
oramaCloudAPIKey: process.env.ORAMA_CLOUD_API_KEY,
deploy: process.env.NODE_ENV === "production",
}
}
],
// Enables our custom pages in "src" to use Tailwind classes
async function tailwindPlugin(_context, _options) {
return {
Expand Down Expand Up @@ -257,45 +268,7 @@ const config = {
theme: lightCodeTheme,
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