{{/* Minimal list of API endpoints for the current page. */}} {{ $raw := .Scratch.Get "api_endpoints" }} {{/* Normalize to a slice */}} {{ $endpoints := slice }} {{ if reflect.IsSlice $raw }} {{ $endpoints = $raw }} {{ else if reflect.IsMap $raw }} {{ range $raw }} {{ $endpoints = append $endpoints . }} {{ end }} {{ end }} {{ if gt (len $endpoints) 0 }}
List of Endpoints {{/* Sort by module to group visually */}} {{ $sorted := sort $endpoints "module" }} {{ $current := "" }} {{ range $sorted }} {{ $mod := .module }} {{/* Set a title for the base endpoints */}} {{ if not $mod }}{{ $mod = "Required" }}{{ end }} {{ if ne $mod $current }} {{ if $current }}
{{ end }}
{{ $mod }}
{{ end }} {{ end }}