#Import content from one markdown file into another
3 messages · Page 1 of 1 (latest)
Hi @steel sierra. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To import a section of text from one Markdown or MDX file into another, you can use the import statement in Astro. Here's an example of how to import a specific Markdown file:
---
// Import a single file
import * as myPost from '../pages/post/my-post.md';
---
For MDX files, you can import and use components just as you would in any other Astro component:
---
layout: ../layouts/BaseLayout.astro
title: About me
---
import Button from '../components/Button.astro';
import ReactCounter from '../components/ReactCounter.jsx';
However, importing a specific section of text is not directly supported. You would need to structure your content in a way that allows you to import the desired section as a separate component or file.