refactor: get headings directly from rendered results without rendering twice

This commit is contained in:
草师傅 2025-07-22 13:40:23 +08:00
parent 276ee70e71
commit 74a8bbc72a
Signed by: gb
GPG key ID: 43330A030E2D6478

View file

@ -19,8 +19,7 @@ export async function getStaticPaths() {
}
const { entry } = Astro.props;
const { Content } = await entry.render();
const headings = await entry.render().then(rendered => rendered.headings);
const { Content, headings } = await entry.render();
const noscript = siteConfig.noClientJavaScript
const slug = Astro.params.slug;