Markdown partials
It’s often useful to reuse the same content in multiple places in your documentation. Markdown partials allow you to have a single source of truth for content that’s displayed on multiple pages.
Create and use a partial
Section titled “Create and use a partial”First, create a partial file. This can be placed anywhere under your src/ directory, but we recommend putting your partials in src/partials:
import Image from "astro/components/Image.astro";import steel from "/src/assets/steel.png";
Below is the Stainless logo:
<Image src={steel} alt="The Stainless logo" style="height: 200px; width: auto;"/>Next, import and render the partial on any page of your site:
---title: Getting starteddescription: This is a description of the page---import MyPartial from "/src/partials/my-partial.mdx";
## Hello, world!
Lorem ipsum dolor sit...
<MyPartial />