fix: backport 11 Coder Agents docs PRs to release/2.33 (#25047)

This commit is contained in:
david-fraley
2026-05-07 13:54:47 -04:00
committed by GitHub
parent 3e34ba7bf0
commit d622e86fa0
39 changed files with 9942 additions and 863 deletions
+13
View File
@@ -209,12 +209,25 @@ func writeDocs(sections [][]byte) error {
continue
}
// Preserve existing state and description on children, keyed by
// title, so that callouts like `state: ["experimental"]` survive
// regeneration. Generated routes always overwrite Title and Path.
existingByTitle := make(map[string]route, len(child.Children))
for _, existing := range child.Children {
existingByTitle[existing.Title] = existing
}
var children []route
for _, mdf := range mdFiles {
docRoute := route{
Title: mdf.title,
Path: mdf.path,
}
if existing, ok := existingByTitle[mdf.title]; ok {
docRoute.State = existing.State
docRoute.Description = existing.Description
docRoute.IconPath = existing.IconPath
}
children = append(children, docRoute)
}