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

Add docussarus-v3 docs #689

Merged
merged 6 commits into from
Apr 9, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,61 @@ outline: deep

# Connect Orama Cloud to Docusaurus

Docusaurus integration is coming soon. Please [contact us](mailto:info@oramasearch.com) or [join our Slack channel](https://orama.to/slack) if you want to be notified when it's ready.
## Pre-requisites

In order guarantee a correct functionality of the plugin, you need to have the `@docusaurus/core` at least in the version `3.2.0`.

::: warning
This plugin do not support Docusaurus v2. Use [`@orama/plugin-docusaurus`](https://www.npmjs.com/package/@orama/plugin-docusaurus) instead.
:::

## Installation

You can install the plugin using any major Node.js package manager:

```bash copy
npm install @orama/plugin-docusaurus-v3
```

```bash copy
pnpm install @orama/plugin-docusaurus-v3
```

```bash copy
yarn add @orama/plugin-docusaurus-v3
```

## Usage

To use the plugin you will need to add it to your docusaurus list of plugins:

```js
// ...
plugins: [
[
"@orama/plugin-docusaurus-v3",
{
cloud: {
indexId: "<your_orama_index_id>",
oramaCloudAPIKey: process.env.ORAMA_CLOUD_API_KEY, // Env variable suggested
deploy: true, // Enables deploy while building/starting
},
},
],
];
// ...
```

To get this variables first create a new integration for HTTP Integrations in here:

![select integrations](/oss/docussarus-1.png)

And then docusaurus:

![select Docusaurus](/oss/docussarus-2.png)

On the next page you will see all the variables you need to get you up and running:

![the variables](/oss/docussarus-3.png)

And you are set, if you set deploy to true your index will update whenever you build the website and there are changes to your pages.
63 changes: 56 additions & 7 deletions packages/docs/open-source/plugins/plugin-docusaurus.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,80 @@ outline: deep

# Docusaurus Plugin

The plugin-docusaurus plugin allows you to index the content of your Docusaurus websites and offer text search to your visitors.
The docusaurus plugin allows you to index the content of your Docusaurus websites and offer text search to your visitors.
This plugin can be used in OSS mode where you host the documents, or in cloud mode where your data will be stored by us and you will have access to analytics where you can see the number of queries and much more.

## Pre-requisites
In order guarantee a correct functionality of the plugin, you need to have the `@docusaurus/core` at least in the version `2.4.3`.

In order guarantee a correct functionality of the plugin, you need to have the `@docusaurus/core` at least in the version `3.2.0`.

::: warning
This plugin do not support Docusaurus v3
This plugin do not support Docusaurus v2. Use [`@orama/plugin-docusaurus`](https://www.npmjs.com/package/@orama/plugin-docusaurus) instead.
:::

## Installation

You can install the plugin using any major Node.js package manager:

```bash copy
npm install @orama/plugin-docusaurus
```bash copy
npm install @orama/plugin-docusaurus-v3
```

```bash copy
pnpm install @orama/plugin-docusaurus-v3
```

```bash copy
yarn add @orama/plugin-docusaurus-v3
```

## Usage

### With Orama OSS

Add the plugin to your `docusaurus.config.js`:

```js
{
// ...
plugins: ["@orama/plugin-docusaurus"],
plugins: ["@orama/plugin-docusaurus-v3"],
// ...
}
```
```

And that's it, you now have a search that will update whenever you build your site.

### With Orama Cloud

If you want to use Orama Cloud as the source so you can have access to analytics for free you need a couple more variables:

```js
// ...
plugins: [
[
"@orama/plugin-docusaurus-v3",
{
cloud: {
indexId: "<your_orama_index_id>",
oramaCloudAPIKey: process.env.ORAMA_CLOUD_API_KEY, // Env variable suggested
deploy: true, // Enables deploy while building/starting
},
},
],
];
// ...
```

To get this variables first create a new integration for HTTP Integrations in here:

![select integrations](/oss/docussarus-1.png)

And then docusaurus:

![select Docusaurus](/oss/docussarus-2.png)

On the next page you will see all the variables you need to get you up and running:

![the variables](/oss/docussarus-3.png)

And you are set, if you set deploy to true your index will update whenever you build the website and there are changes to your pages.
Binary file added packages/docs/public/oss/docussarus-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/docs/public/oss/docussarus-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/docs/public/oss/docussarus-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading