From 1bd952163abbf7ac6b6cca7533ed6f25214efd31 Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Tue, 5 May 2026 13:03:07 +0200 Subject: [PATCH] fix(agent-docs): include hero title in markdown endpoint for parity --- plugins/astro-agent-docs.mjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/astro-agent-docs.mjs b/plugins/astro-agent-docs.mjs index 8dd3dde..0eeb479 100644 --- a/plugins/astro-agent-docs.mjs +++ b/plugins/astro-agent-docs.mjs @@ -105,7 +105,15 @@ function cleanMarkdown(raw, isMdx = false) { } body = body.replace(/\n{3,}/g, "\n\n").trim(); const title = data.title ? `# ${data.title}\n\n` : ""; - return BOM + title + LLMS_TXT_DIRECTIVE + body + "\n"; + // Include hero text for splash pages — rendered in HTML but not in the content body. + let heroText = ""; + if (data.hero?.title) { + heroText += data.hero.title.replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim() + "\n\n"; + } + if (data.hero?.tagline) { + heroText += data.hero.tagline + "\n\n"; + } + return BOM + title + heroText + LLMS_TXT_DIRECTIVE + body + "\n"; } /**