Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/references/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Reference"
title: "References"
description: "Specifications, canister IDs, token standards, cycle costs, and technical reference for ICP"
sidebar:
hidden: true
Expand Down
10 changes: 8 additions & 2 deletions plugins/astro-agent-docs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
Loading