Astro Quick-Start Guide

Creating and Displaying Content with Markdown

The simplest way to add content to an Astro site is to use Markdown. Here's how to do it.

The sim­plest way to add con­tent to an Astro site is to use Mark­down. This isn’t like­ly how you’ll use Astro if you plan to pow­er it entire­ly with con­tent from Craft CMS. How­ev­er, you can com­bine mark­down and Craft CMS sources of con­tent, so this will still be handy to know and understand.

With Astro, you can use either:

  • stan­dard mark­down or 
  • MDX, an enhanced fla­vor of mark­down that sup­ports using JavaScript expres­sions and com­po­nents right inside the mark­down files. This would be clos­er to work­ing with a typ­i­cal Astro com­po­nent ver­sus a sim­ple Mark­down file.

To use MDX, we will need to use the Astro MDX inte­gra­tion. We’ll set that up in the next video.

Stan­dard mark­down and MDX files can be placed in the pages direc­to­ry and made auto­mat­i­cal­ly routable to a URI based on the file name. 

And, we can define and store data about the mark­down file in the front­mat­ter. This is a great place to put a title, author, or oth­er meta­da­ta about the arti­cle or content. 

We want to cre­ate a Dis­claimer page on the real estate site for our project. We’ll do that using a sin­gle routable file in the pages direc­to­ry. Instead of it being an Astro com­po­nent, we’ll cre­ate a mark­down file.

Astro Quick-Start Guide is made up of the following videos: