diff --git a/astro.config.mjs b/astro.config.mjs index 00de01b0e..f20159a39 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -162,20 +162,16 @@ export default defineConfig({ }, }, plugins: [ - ...(llmsTxt - ? [ - starlightLlmsTxt({ - projectName: "Tenzir", - description: - "The low-code data pipeline solution for security teams", - perPageMarkdown: { - extensionStrategy: "replace", - }, - sitemapAlias: true, - preambles: true, - }), - ] - : []), + starlightLlmsTxt({ + llmsTxt, + projectName: "Tenzir", + description: "The low-code data pipeline solution for security teams", + perPageMarkdown: { + extensionStrategy: "replace", + }, + sitemapAlias: llmsTxt, + preambles: llmsTxt, + }), ...(checkLinks ? [ starlightLinksValidator({ diff --git a/src/components/PageTitle.astro b/src/components/PageTitle.astro index 9a9bd2c1e..4610cd046 100644 --- a/src/components/PageTitle.astro +++ b/src/components/PageTitle.astro @@ -1,6 +1,6 @@ --- -import type { Props } from "@astrojs/starlight/props"; import { pathWithBase } from "@utils/base"; +import { markdownPathForDocPath } from "@utils/llm-markdown-path"; import { formatSlug, getDocsMap } from "@utils/page-title"; import { getSearchWeight } from "../search-weights"; @@ -24,6 +24,16 @@ const { starlightRoute } = Astro.locals; const weightConfig = getSearchWeight(starlightRoute.id); const pagefindType = weightConfig?.metadata?.type; const pagefindWeight = weightConfig?.weight; +// The per-page Markdown twin only exists for pages backed by the `docs` +// content collection. Pages injected by other integrations (e.g. starlight- +// openapi) have no `.md` route, so we hide the action buttons there. +const hasMarkdownTwin = docsMap.has(starlightRoute.entry.id); +const markdownUrl = pathWithBase( + markdownPathForDocPath(starlightRoute.entry.id), +); +const agentSkillsGuideUrl = pathWithBase( + "/guides/ai-workbench/use-agent-skills/", +); // Build h1 attributes const h1Attrs: Record = { @@ -168,24 +178,685 @@ for (let i = 0; i < segments.length; i++) { )} -

- {starlightRoute.entry.data.title} -

+
+

+ {starlightRoute.entry.data.title} +

+ {hasMarkdownTwin && ( + + )} +
+ +