// Package pages is the dashboard's page catalogue: every route the operator can // reach, with the label its navigation shows and the one-line description the // assistant reads when it points someone at a page. // // pages.json is generated from the dashboard's own route table by // `task pages:generate`, and `task check` rejects it when stale, so the // catalogue cannot list a page the dashboard lost or miss one it gained. package pages import ( _ "embed" "encoding/json" "fmt" ) //go:embed pages.json var file []byte // Page is one destination in the dashboard. type Page struct { // Path is the route, and what the browser's history entry becomes. Path string `json:"path"` // Label is the name the navigation shows. Label string `json:"label"` // Description says what the page is for, so the assistant can answer // "where do I go for that?" without guessing. Description string `json:"description"` } // All returns the catalogue in the dashboard's own order. func All() ([]Page, error) { var out []Page if err := json.Unmarshal(file, &out); err != nil { return nil, fmt.Errorf("dashboard pages: %w", err) } return out, nil }