0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-04-07 23:41:43 -05:00

fix: function order

This commit is contained in:
bholmesdev 2022-07-11 17:40:57 -04:00
parent c576afcfe8
commit 7d466d71d6

View file

@ -162,14 +162,15 @@ export default function markdown({ config }: AstroPluginOptions): Plugin {
content.astro = metadata;
const prelude = `---
import Slugger from 'github-slugger';
function $$slug(value) {
return slugger.slug(value);
}
${layout ? `import Layout from '${layout}';` : ''}
${components ? `import * from '${components}';` : ''}
${hasInjectedScript ? `import '${PAGE_SSR_SCRIPT_ID}';` : ''}
${setup}
function $$slug(value) {
return slugger.slug(value);
}
const $$content = ${JSON.stringify(content)}
---`;
const imports = `${layout ? `import Layout from '${layout}';` : ''}