0

I'm new to Docusaurus and wonder is there a way to embed GitHub gists into docusaurus docs?

I found this module: https://github.com/winoteam/docusaurus-gist-embed but I don't seem to get it to work.

AlBlue
  • 23,254
  • 14
  • 71
  • 91
NBayaman
  • 103
  • 8

2 Answers2

2

Easy one, install this package in your Docusaurus project

https://www.npmjs.com/package/react-gist

the in your markdown add the import statement along with a Gist JSX code with your Gist id as shown below:

---
title: yourtitle
---
import Gist from 'react-gist';

<Gist id="9b9985dbf8163ade22b71f2ccf20cb51" 
/>
jeffreyaven
  • 186
  • 1
  • 6
0

Docusaurus 2 is based on MDX so any react component you put in the markdown should render, including an iframe with a gist or whatever you want.

Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419