Skip to content

Commit

Permalink
Add docussarus-v3 docs (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaraVieira authored Apr 9, 2024
2 parents e0c62b0 + 1e25d51 commit 1f53eb3
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 8 deletions.
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.

0 comments on commit 1f53eb3

Please sign in to comment.