Rework docs navigation and move alternatives to top-level pages (#1487)
* Rework docs navigation and move alternatives to top-level pages - Add nested docs nav with categories, collapsible groups, breadcrumbs, and a right-hand page outline with heading slugs. - Move alternatives out of /docs/alternatives into /alternatives/* marketing pages with 301 redirects. - Add github-slugger for heading IDs and require explicit width on SiteShell so new pages can't accidentally pick the narrow prose layout. - Remove the best-practices doc from public-docs. * Make docs content column prose-width
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { getAlternativePages } from "~/data/alternative-pages";
|
||||
import { AGENT_PAGES } from "~/data/agent-pages";
|
||||
import { type Doc, getDocs } from "~/docs";
|
||||
|
||||
@@ -27,17 +28,19 @@ function agentLine(agent: (typeof AGENT_PAGES)[number]): string {
|
||||
return `- [${agent.name}](${SITE_URL}/${agent.slug}): ${agent.subtitle}`;
|
||||
}
|
||||
|
||||
function alternativeLine(page: ReturnType<typeof getAlternativePages>[number]): string {
|
||||
const description = page.description.trim();
|
||||
const suffix = description ? `: ${description}` : "";
|
||||
return `- [${page.title}](${SITE_URL}${page.href})${suffix}`;
|
||||
}
|
||||
|
||||
function topLevelDocs(): Doc[] {
|
||||
return getDocs().filter((d) => !d.slug.includes("/"));
|
||||
}
|
||||
|
||||
function alternativeDocs(): Doc[] {
|
||||
return getDocs().filter((d) => d.slug.startsWith("alternatives/"));
|
||||
}
|
||||
|
||||
export function buildLlmsTxt(): string {
|
||||
const docs = topLevelDocs().map(docLine).join("\n");
|
||||
const alternatives = alternativeDocs().map(docLine).join("\n");
|
||||
const alternatives = getAlternativePages().map(alternativeLine).join("\n");
|
||||
const agents = AGENT_PAGES.map(agentLine).join("\n");
|
||||
|
||||
return `${PRODUCT_PREAMBLE}
|
||||
|
||||
Reference in New Issue
Block a user