We’ve recorded the workshop when Astro is in 1.0.0-Beta.
Now Astro is already in v3 so some of the stuff you’re going to see here will be outdated.
Even though some stuff is outdated, this workshop will still work and will give a great foundation on building with Astro, using a CMS with Sanity, and deploying with Netlify.
Here are the things that have changed:
Markdown Components have been deprecated and removed in favour of MDX
You can still use Markdown Components by installing the component through npm, then using it like this:
---import Markdown from '@astrojs/markdown-component'---
<Markdown> # Markdown syntax is now supported!
**Yay!**</Markdown>A bit about MDX
You can think of MDX as MD + JSX — so you can write some JavaScript code within a markdown file.
This gives you the ability to do lots of things which, unfortunately, I will not be able to explain in full detail in this short intro.
Building with MDX in Astro is an amazing experience, but it requires you to change the way you’re thinking about Markdown.
The general idea is you’ll use an mdx file instead of an astro file so you’re writing MDX throughout.
If you’re interested in how I would do this, feel free to request this as a topic in our community — Dojo. 🙂
Astro.canonicalURL has been deprecated
To get the Canonical URL, you can use this code instead:
const URLObject = new URL(Astro.url.pathname, Astro.site)const canonicalURL = URLObject.hrefThat’s it!
Welcome! Unfortunately, you don’t have access to this lesson. To get access, please purchase the workshop or enroll in Magical Dev School.
Unlock this lesson