diff --git a/docs/references/index.md b/docs/references/index.md index cd0b3d7..05c2b16 100644 --- a/docs/references/index.md +++ b/docs/references/index.md @@ -1,5 +1,5 @@ --- -title: "Reference" +title: "References" description: "Specifications, canister IDs, token standards, cycle costs, and technical reference for ICP" sidebar: hidden: true diff --git a/plugins/astro-agent-docs.mjs b/plugins/astro-agent-docs.mjs index 637ed4d..8dd3dde 100644 --- a/plugins/astro-agent-docs.mjs +++ b/plugins/astro-agent-docs.mjs @@ -53,8 +53,14 @@ function deriveSections(items, parentLabel = "", depth = 0) { const childSections = deriveSections(item.items, item.label, depth + 1); sections.push(...childSections); - // Add a parent fallback if children have a common directory prefix - const childDirs = childSections.map((s) => s.dir); + // Add a parent fallback if children have a common directory prefix. + // Also include directory prefixes from explicit { slug } children so that + // groups listing pages individually (rather than via autogenerate) still + // get a section entry for llms.txt prefix matching. + const directSlugDirs = item.items + .filter((c) => c.slug && c.slug.includes("/")) + .map((c) => c.slug.split("/").slice(0, -1).join("/")); + const childDirs = [...childSections.map((s) => s.dir), ...directSlugDirs]; const commonPrefix = findCommonPrefix(childDirs); if (commonPrefix) { sections.push({ dir: commonPrefix, label: item.label });