1.0.2 • Published 3 months ago

@oramacloud/plugin-docusaurus v1.0.2

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

Orama Cloud - Docusaurus Plugin

A plugin to integrate Docusaurus with your Orama Cloud indexes.

Prerequisites

This project requires NodeJS (version 18 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.

$ npm -v && node -v
9.6.7
v18.17.1

Table of contents

Getting Started

In order to use this plugin in your build process you will also need a Docusaurus index in Orama Cloud. To start using it you can create a free account at cloud.oramasearch.com. After creating your account you can create a new index and copy the index ID and Private API key provided in the index settings page.

Installation

BEFORE YOU INSTALL: please read the prerequisites

To install and set up the library, run:

$ npm install -S @oramacloud/plugin-docusaurus

Or if you prefer using Yarn:

$ yarn add @oramacloud/plugin-docusaurus

Or if you prefer using PNPM:

$ pnpm add @oramacloud/plugin-docusaurus

Usage

Adding the plugin to your Docusaurus project

Add the plugin to your config file:

// docusaurus.config.js

{
  plugins: ['@oramacloud/plugin-docusaurus']
}

Run your build process

After adding the plugin to your Docusaurus project you can run your build process adding the Orama Cloud env variables to it.

GitHub Actions example:

name: Node.js CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    env: 
      ORAMA_CLOUD_PRIVATE_API_KEY: <your_private_api_key>
      ORAMA_CLOUD_INDEX_ID: <your_index_id>
    steps:
      - uses: actions/checkout@v4
      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '20.x' # 18.x or 20.x
      - run: npm ci
      - run: npm run build --if-present
      - run: npm test

To understand better how to add env variables to your GH Actions workflow check the GitHub Actions variables docs