diff --git a/web/src/components/post/toc.astro b/web/src/components/post/toc.astro
index bf6c008..97bf00a 100644
--- a/web/src/components/post/toc.astro
+++ b/web/src/components/post/toc.astro
@@ -15,6 +15,20 @@
lnk.href=`#${tag.id}`
lnk.className = 'b1-no-underline'
lnk.innerHTML = `${"#".repeat(depth)}${tag.innerHTML}`
+
+ // Add smooth scroll with offset
+ lnk.addEventListener('click', (e) => {
+ e.preventDefault()
+ const target = document.getElementById(tag.id)
+ if (target) {
+ const offset = 20 // pixels from top
+ const targetPosition = target.getBoundingClientRect().top + window.pageYOffset - offset
+ window.scrollTo({
+ top: targetPosition,
+ behavior: 'smooth'
+ })
+ }
+ })
let li = document.createElement('li')
li.className = 'line-clamp-1'
diff --git a/web/src/pages/posts/[slug].astro b/web/src/pages/posts/[slug].astro
index 367cda2..df31923 100644
--- a/web/src/pages/posts/[slug].astro
+++ b/web/src/pages/posts/[slug].astro
@@ -23,9 +23,8 @@ const readTime = calcReadTime(wordCount);
{title}
- -{description}