| undefined;
+ function showToast(message: string) {
+ if (!toast) return;
+ toast.textContent = message;
+ toast.classList.add('visible');
+ clearTimeout(toastTimer);
+ toastTimer = setTimeout(() => toast.classList.remove('visible'), 2000);
}
}
diff --git a/src/components/CustomPageTitle.astro b/src/components/CustomPageTitle.astro
index d436058ba..4f557a800 100644
--- a/src/components/CustomPageTitle.astro
+++ b/src/components/CustomPageTitle.astro
@@ -1,8 +1,6 @@
---
import CopyPageButton from './CopyPageButton.astro';
-// Starlight types `entry.body` as `string | undefined`; fall back to ''
-// so consumers (CopyPageButton) get a stable `string`.
const title = Astro.locals.starlightRoute.entry.data.title;
// Surface the page's `description` frontmatter as a visible subtitle below
// the H1. Starlight's default `PageTitle` only uses `description` for the
@@ -12,7 +10,6 @@ const title = Astro.locals.starlightRoute.entry.data.title;
// `&& ` guard keeps any future page that omits the field from emitting
// an empty paragraph.
const description = Astro.locals.starlightRoute.entry.data.description;
-const body = Astro.locals.starlightRoute.entry.body ?? '';
// Eyebrow: a 2-level breadcrumb (e.g. "Agents > Third-Party CLI Agents")
// shown above the H1 to orient readers who land directly from search.
@@ -46,18 +43,32 @@ const eyebrow = topicLabel && parentGroup && parentGroup !== topicLabel
---
{eyebrow &&
{eyebrow}
}
+{/* Source order is H1 -> description -> Copy menu so that the text directly
+ after `` in the raw HTML is the page's own summary, not menu labels.
+ Search and answer engines anchor snippets on the H1 and the text that
+ follows it. The grid below keeps the visual layout unchanged: the Copy
+ menu sits to the right of the H1 and the description spans underneath. */}
{title}
-
+ {description &&
{description}
}
+
+
+
-{description && {description}
}