Created
May 15, 2021 14:14
-
-
Save natemoo-re/12c6661d87707b641b0bed446a114c69 to your computer and use it in GitHub Desktop.
Astro Markdown sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
import Markdown from 'astro/components/Markdown.astro'; | |
import Layout from '../layouts/main.astro'; | |
import ReactComponent from '../components/ReactComponent.jsx'; | |
import PreactComponent from '../components/PreactComponent.tsx'; | |
import VueComponent from '../components/VueComponent.vue'; | |
import SvelteComponent from '../components/SvelteComponent.svelte'; | |
const title = 'Astro Markdown'; | |
const variable = 'content'; | |
const items = ['A', 'B', 'C']; | |
--- | |
<Layout> | |
<Markdown> | |
# Introducing {title} | |
**Astro Markdown** brings native Markdown support to HTML! | |
> It's inspired by [`mdx`](https://mdxjs.com/) and powered by [`remark`](https://github.com/remarkjs/remark)). | |
The best part? It comes with all the Astro features you expect. | |
## Embed framework components | |
<ReactComponent /> | |
<PeactComponent:load /> | |
<VueComponent:idle /> | |
<SvelteComponent:visible /> | |
## Use Expressions | |
You can use any {variable} in scope and use JavaScript for templating {items.join(', ')} | |
## Oh yeah... | |
<ReactComponent> | |
🤯 It's also _recursive_! | |
### Markdown can be embedded in any child component | |
</ReactComponent> | |
</Markdown> | |
</Layout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment