Skip to main content

How to Add an Image

Add a new image to C-CORE docs site!

Save image to the static folder#

Place the image file in the docs/static/img/ folder.

Add image as a mdx component#

First, import the useBaseUrl function at the top of the doc, just after the metadata. This functions helps assure the url is correct after Docusaurus performs various optimizations at build.

---id: add-image-tutorialtitle: How to Add an Imagesidebar_label: How to Add an Image--- import useBaseUrl from '@docusaurus/useBaseUrl'

Then, add an image component.

---id: add-image-tutorialtitle: How to Add an Imagesidebar_label: How to Add an Image--- import useBaseUrl from '@docusaurus/useBaseUrl'
<img alt="Tokyo turnips" src={useBaseUrl('img/tokyo-turnips.jpg')} />
Tokyo turnips