Skip to content

useflyyer/docusaurus-preset

Repository files navigation

Flyyer x Docusaurus

To create dynamic image previews please refer to docs.flyyer.io.

This plugin required Docusaurus v2. There is no support for v1.

Need help? Join our Discord

Install

yarn add @flyyer/docusaurus-preset @flyyer/flyyer

# or with npm
npm install --save @flyyer/docusaurus-preset @flyyer/flyyer

On your docusaurus.config.js add @flyyer/docusaurus-preset at the end of your presets array:

{
  // ...
  presets: [
    // ...
    [
      "@flyyer/docusaurus-preset",
      {
        flyyer: {
          /**
           * Get your project's id at https://flyyer.io/dashboard/_/projects/_/integrate
           */
          project: "",
        }
      },
    ],
  ],
}

Advanced

Signed URLs

To prevent bad actors from generating images you can sign your URLs.

🔑 Get your secret key here: flyyer.io/dashboard//projects//advanced.

Note: This key is different form your FLYYER_KEY.

{
  presets: [
    [
      "@flyyer/docusaurus-preset",
      {
        flyyer: {
          project: "",
          secret: process.env.FLYYER_SIGNATURE_KEY || "your-key",
          strategy: "JWT", // "JWT" | "HMAC"
        }
      },
    ],
  ],
}

Development

Clone this repository with:

git clone https://github.com/useflyyer/docusaurus-preset.git
cd docusaurus-preset

Install dependencies and bootstrap Lerna:

yarn install
yarn run bootstrap

Build packages:

yarn run build

Publishing

Create a new Lerna version:

yarn run lerna version

Publish packages:

yarn run lerna publish from-git --yes

License

MIT