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:
parent
c576afcfe8
commit
7d466d71d6
1 changed files with 4 additions and 3 deletions
|
@ -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}';` : ''}
|
||||
|
|
Loading…
Add table
Reference in a new issue