Complete the code to import a Markdown file in an Astro component.
import Content from './post[1]';
The correct file extension for Markdown files is .md. This import allows Astro to load the Markdown content.
Complete the code to render Markdown content inside an Astro component.
<Content [1] />default which is not a valid prop hereis:rawUsing is:raw renders the imported Markdown content as raw HTML inside an Astro component.
Fix the error in this MDX import statement to correctly import an MDX file.
import Article from './article[1]';
MDX files use the .mdx extension, so the import must specify this to work correctly.
Fill both blanks to create a frontmatter export and use it in an Astro Markdown page.
--- export const [1] = { title: 'My Post', }; --- <h1>{frontmatter.[2]</h1>
metadataThe frontmatter object is exported as frontmatter and the title is accessed as frontmatter.title.
Fill all three blanks to create a dynamic import and render an MDX page with frontmatter.
import [1] from './blog/[2].mdx'; --- const { [3] } = Post.frontmatter; --- <h1>{title}</h1> <Post />
The MDX file is imported as Post, the filename is post-1, and the frontmatter property title is extracted for display.
