{{/* Renders a list of API endpoints for the current page, given: The outer page's Scratch must contain an "api_endpoints" key, which is either a slice of maps (a list of endpoint metadata dicts) or a map of module name -> slice of endpoint metadata dicts (representing the API modules and the endpoints they each contain). Each endpoint dict must contain the following keys: * `anchor`: the HTML anchor for the endpoint * `method`: the HTTP method * `endpoint`: the endpoint path * `summary`: a short summary of the endpoint * `deprecated`: whether the endpoint is deprecated * `module`: the CS API module name, if any, for grouping purposes. If empty, the endpoint is considered "base" or "required". */}} {{ $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 }}