docs-v2/layouts/partials/api/renderer.html

24 lines
612 B
HTML

{{/*
API Renderer Abstraction
Selects and loads the appropriate API documentation renderer.
RapiDoc is the primary renderer.
Required page params:
- staticFilePath: Path to the OpenAPI specification file
Site params:
- apiRenderer: "rapidoc" (default) or "scalar"
*/}}
{{ $renderer := site.Params.apiRenderer | default "rapidoc" }}
{{ if eq $renderer "rapidoc" }}
{{ partial "api/rapidoc.html" . }}
{{ else if eq $renderer "scalar" }}
{{ partial "api/scalar.html" . }}
{{ else }}
{{/* Fallback to rapidoc if unknown renderer specified */}}
{{ partial "api/rapidoc.html" . }}
{{ end }}