Build a Docusaurus-like Site with FastAPI: Step 5 - Handling Static Files
dev.to·19h·
Discuss: DEV
Flag this post

In the previous article, we added support for parsing Markdown Frontmatter. This allows our document metadata (like the title) to be defined within the Markdown file along with the content, avoiding hard-coding.

Besides text and code, a document usually includes static resources like images.

Currently, if you reference an image in hello.md, it won’t display. In this article, we will solve this problem by enabling FastAPI to correctly handle and serve static resources, like images, referenced in our Markdown files.

Why Won’t the Image Display?

Here is a Markdown document that includes an image leapcell-logo.png:

# Hello, Markdown!

Here is a Logo:
![Leapcell Logo](./leapc...

Similar Posts

Loading similar posts...