diff --git a/astro.config.mjs b/astro.config.mjs
index 28feda494..40434ba59 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -24,6 +24,9 @@ export default defineConfig({
apiDocsOnly(rehypeAutolinkHeadings),
{
behavior: "append",
+ // Only h2+ get anchors. The page's
is its title and getting a
+ // link to it is meaningless — the page URL already points there.
+ test: ["h2", "h3", "h4", "h5", "h6"],
properties: {
className: ["heading-anchor"],
"data-anchor-link": true,
diff --git a/src/components/docs/heading-anchor-assets.astro b/src/components/docs/heading-anchor-assets.astro
new file mode 100644
index 000000000..d921f51ce
--- /dev/null
+++ b/src/components/docs/heading-anchor-assets.astro
@@ -0,0 +1,90 @@
+---
+// Heading-anchor styles + clipboard/scroll JS. Loaded by docs-layout.astro
+// only on /docs/api-documentation/ pages.
+---
+
+
+
+
diff --git a/src/layouts/docs-layout.astro b/src/layouts/docs-layout.astro
index a9ef487ae..7b7857995 100644
--- a/src/layouts/docs-layout.astro
+++ b/src/layouts/docs-layout.astro
@@ -1,4 +1,5 @@
---
+import HeadingAnchorAssets from "@/components/docs/heading-anchor-assets.astro";
import Header from "@/components/docs/header.astro";
import MarketingHeader from "@/components/header/header.astro";
@@ -55,108 +56,4 @@ const isApiDocs = Astro.url.pathname.startsWith("/docs/api-documentation/");
-{/*
- Shareable heading anchors: rehype-autolink-headings injects
- #
- after every heading in MD/MDX under api-documentation; .astro pages add
- the same markup manually. Styles + clipboard/scroll behaviour are gated
- to API docs so non-API docs keep their original heading behaviour.
-*/}
-{
- isApiDocs && (
-
- )
-}
-
-{
- isApiDocs && (
-
- )
-}
+{isApiDocs && }
diff --git a/src/pages/docs/api-documentation/console-api/api-reference.astro b/src/pages/docs/api-documentation/console-api/api-reference.astro
index 61be189bc..afaa765dd 100644
--- a/src/pages/docs/api-documentation/console-api/api-reference.astro
+++ b/src/pages/docs/api-documentation/console-api/api-reference.astro
@@ -314,18 +314,10 @@ const sectionsLite = sections.map((s) => ({ id: s.id, title: s.title }));
diff --git a/src/pages/docs/api-documentation/getting-started.astro b/src/pages/docs/api-documentation/getting-started.astro
index b1bb8d3e6..924536673 100644
--- a/src/pages/docs/api-documentation/getting-started.astro
+++ b/src/pages/docs/api-documentation/getting-started.astro
@@ -236,15 +236,7 @@ const helpLinks = [