- Documentation
- Write content
- Images and files
Images and files
Add images, show a different one in light and dark mode, and serve files such as PDFs.
Put an image in your docs folder and show it with Markdown. Specly copies it to your site.
Add an image
Section titled “Add an image”Always write the text between the brackets. It’s what a screen reader says, and what readers see if the image doesn’t
load. The path starts at the docs folder, or at public/, so /logo/light.svg is the file logo/light.svg.
You can also use an HTML <img> tag, to set a size:
<img src="/logo/light.svg" alt="Specly's logo" width="160" />Light and dark images
Section titled “Light and dark images”An image made for a light page can disappear on a dark one. Give each mode its own image, and readers see the one for
their mode. Specly reads Mintlify’s pair of classes, block dark:hidden and hidden dark:block:
<img className="block dark:hidden" src="/logo/light.svg" alt="Specly's logo, for light mode" /><img className="hidden dark:block" src="/logo/dark.svg" alt="Specly's logo, for dark mode" />Switch your site to dark mode to see the other image.
Other files
Section titled “Other files”Any image, font, PDF, audio or video file in your docs folder is served at its path. Link to a file the way you link to a page:
[Download the checklist](/files/checklist.pdf)Specly serves these types: PNG, JPEG, GIF, SVG, WebP, AVIF, ICO, WOFF, WOFF2, TTF, OTF, PDF, MP4, WebM, MOV, MP3, WAV, TXT and ZIP.
Pages, docs.json and code files are never served this way.
public/
Section titled “public/”Files in a public/ folder are served from the root of your site: public/favicon.svg is at /favicon.svg. A public/CNAME file holding your site’s address sets its canonical links and sitemap. See SEO.