diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 17615bf..8fbe0cc 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -52,12 +52,12 @@ const { title, description, image, type, noindex, math, navbarOverlay = false, h const applyPanguSpacing = () => { document.querySelectorAll('pre, code, .line').forEach((el) => el.classList.add('no-pangu-spacing')); - document.querySelectorAll('.prose p, .prose li, .prose blockquote, .prose h1, .prose h2, .prose h3, .prose h4').forEach((el) => { - pangu.spacingNode(el); - }); + pangu.spacingNode(document.body); }; + pangu.taskScheduler.config.enabled = false; applyPanguSpacing(); + pangu.autoSpacingPage({ pageDelayMs: 0, nodeDelayMs: 0, nodeMaxWaitMs: 100 }); document.addEventListener('astro:page-load', applyPanguSpacing); const initCodeLineNumbers = () => { diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index 72a1a35..d7114ae 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -45,8 +45,8 @@ const dateText = `${date.year} 年 ${date.month} 月 ${date.day} 日`; {tags.map((tag) => #{tag})} }