mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-27 19:38:37 +01:00
30 lines
899 B
HTML
30 lines
899 B
HTML
{{/* 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 }}
|
|
<div class="endpoints-toc mb-4">
|
|
<details>
|
|
<summary>List of Endpoints</summary>
|
|
<ul class="endpoint-list">
|
|
{{ range $endpoints }}
|
|
<li>
|
|
<a href="#{{ .anchor }}">
|
|
<span class="http-api-method">{{ .method }}</span>
|
|
<span class="endpoint-path">{{ .endpoint }}</span>
|
|
{{ if .deprecated }}<span class="endpoint-deprecated">(deprecated)</span>{{ end }}
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</details>
|
|
</div>
|
|
{{ end }}
|