Back to Vector

Endpoints

website/layouts/shortcodes/api/endpoints.html

0.55.0613 B
Original Source

{{ $api := site.Data.docs.api }} {{ $endpoints := $api.endpoints }} {{ $colors := dict "GET" "text-green-500" "POST" "text-indigo-400" }}

{{ range $path, $info := $endpoints }} {{ range $method, $v := $info }} {{ $color := index $colors $method }} {{ $id := printf "%s %s" $method $path | urlize | replaceRE "/" "" }}

{{- $method -}} {{- $path -}}

{{ with $v.description }} {{ . | markdownify }} {{ end }} {{ with $v.responses }}

Responses

Code

Description

{{ range $code, $v := . }}

{{ $code }}

{{ $v.description | markdownify }}

{{ end }}

{{ end }} {{ end }} {{ end }}