svelte-preprocess-markdown
svelte-preprocess-markdown copied to clipboard
Import and Frontmatter?
Apologies if I'm just missing something in the docs, I cannot seem to get this to work.
I have a post that contains frontmtter that I also would like to use a component in. Doing this gets the following error: SyntaxError: import declarations may only appear at top level of a module
---
title: Markdown Post Processing (MDX-ish)
date: 2020-05-04
---
<script>
import Button from './button.svelte'
</script>
And doing this will render the frontmatter to the page with two <hr/>
s
<script>
import Button from './button.svelte'
</script>
---
title: Markdown Post Processing (MDX-ish)
date: 2020-05-04
---
Is it possible to do both?
Just tested with the default svelte template+svelte-preprocess-markdown. Your first example works great. See this example in attachment. testmd.zip