From 74a8bbc72ae66c41e85203a2381450c646b129b0 Mon Sep 17 00:00:00 2001 From: grassblock Date: Tue, 22 Jul 2025 13:40:23 +0800 Subject: [PATCH] refactor: get headings directly from rendered results without rendering twice --- src/pages/blog/[...slug].astro | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 1a20332..7d23fc7 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -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;