Skip to content

Commit fe2fb7e

Browse files
committed
fix(platform): stop generating main api resource pages
Main page files (e.g., resources/clusterroletemplate.mdx) are now manually maintained following the vcluster pattern where partials are auto-generated but main pages are always manual. This allows adding custom documentation sections like platform-specific RBAC verbs that won't be overwritten by loft-bot regeneration. Partials (reference.mdx, create.mdx, etc.) continue to be regenerated on each run. Closes DOC-1196
1 parent cd49111 commit fe2fb7e

2 files changed

Lines changed: 4 additions & 154 deletions

File tree

hack/platform/util/schema.go

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -275,44 +275,10 @@ func GenerateObjectOverview(information *ObjectInformation) {
275275
})
276276
}
277277

278-
relPath := ""
279-
dir, file := path.Split(information.File)
280-
for file != "api" {
281-
dir, file = path.Split(strings.TrimSuffix(dir, "/"))
282-
if file == "" {
283-
panic("Unsupported path: " + information.File)
284-
}
285-
286-
if file != "api" {
287-
relPath += "../"
288-
}
289-
}
290-
if relPath == "" {
291-
relPath = "."
292-
}
293-
relPath = strings.TrimSuffix(relPath, "/")
294-
295-
// write overview
296-
writeTemplate(TemplateObjectOverview, information.File, ObjectOverviewValues{
297-
Title: information.Title,
298-
Resource: information.Resource,
299-
Description: information.Description,
300-
RelativePath: relPath,
301-
Name: information.Name,
302-
Plural: information.Plural,
303-
YAMLObject: string(out),
304-
305-
Project: information.Project,
306-
307-
Create: information.Create,
308-
Retrieve: information.Retrieve,
309-
Update: information.Update,
310-
Delete: information.Delete,
311-
312-
SubResource: information.SubResource,
313-
SubResourceCreate: information.SubResourceCreate,
314-
SubResourceGet: information.SubResourceGet,
315-
})
278+
// Main page files (e.g., resources/clusterroletemplate.mdx) are NOT generated.
279+
// They must be manually created and maintained, following the vcluster pattern
280+
// where partials are auto-generated but main pages are always manual.
281+
// This allows adding custom documentation sections that won't be overwritten.
316282
}
317283

318284
func GenerateFromPath(schema *jsonschema.Schema, basePath string, schemaPath string, defaults map[string]interface{}) {

hack/platform/util/template_overview.go

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)