refactor: get headings directly from rendered results without rendering twice
This commit is contained in:
parent
276ee70e71
commit
74a8bbc72a
1 changed files with 1 additions and 2 deletions
|
@ -19,8 +19,7 @@ export async function getStaticPaths() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const { entry } = Astro.props;
|
const { entry } = Astro.props;
|
||||||
const { Content } = await entry.render();
|
const { Content, headings } = await entry.render();
|
||||||
const headings = await entry.render().then(rendered => rendered.headings);
|
|
||||||
|
|
||||||
const noscript = siteConfig.noClientJavaScript
|
const noscript = siteConfig.noClientJavaScript
|
||||||
const slug = Astro.params.slug;
|
const slug = Astro.params.slug;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue