2023-10-09 15:42:51 +00:00
|
|
|
{{- $page := .page }}
|
2024-04-03 21:30:51 +00:00
|
|
|
{{- $location := .location }}
|
|
|
|
{{- if eq $location "footer" }}
|
|
|
|
{{- with $page }}
|
2024-07-04 06:23:54 +00:00
|
|
|
{{- $assetBusting := partialCached "assetbusting.hugo" . }}
|
|
|
|
<script src="{{"js/js-yaml.min.js" | relURL}}{{ $assetBusting }}" defer></script>
|
2024-04-03 21:30:51 +00:00
|
|
|
{{- $urlOpenapi := "" }}
|
|
|
|
{{- $relOpenapi := "" }}
|
|
|
|
{{- $cssInProject := false }}
|
|
|
|
{{- if and (isset .Params "customopenapiurl") .Params.customOpenapiURL }}
|
|
|
|
{{- $urlOpenapi = .Params.customOpenapiURL }}
|
|
|
|
{{- $relOpenapi = .Params.customOpenapiURL }}
|
|
|
|
{{- else if and (isset .Site.Params "customopenapiurl") .Site.Params.customOpenapiURL }}
|
|
|
|
{{- $urlOpenapi = .Site.Params.customOpenapiURL }}
|
|
|
|
{{- $relOpenapi = .Site.Params.customOpenapiURL }}
|
|
|
|
{{- else }}
|
2024-07-04 06:23:54 +00:00
|
|
|
{{- $urlOpenapi = printf "%s%s" ("js/swagger-ui/swagger-ui-bundle.js" | relURL) $assetBusting }}
|
|
|
|
{{- $relOpenapi = printf "%s%s" ("/js/swagger-ui/swagger-ui-bundle.js") $assetBusting }}
|
2024-04-03 21:30:51 +00:00
|
|
|
{{- $cssInProject = true }}
|
|
|
|
{{- end }}
|
2023-10-09 15:42:51 +00:00
|
|
|
<script>window.noZensmooth = true;</script>
|
|
|
|
<script src="{{ $urlOpenapi }}" defer></script>
|
2024-04-03 21:30:51 +00:00
|
|
|
{{- $urlOpenapi := replace $urlOpenapi "swagger-ui-bundle" "swagger-ui-standalone-preset" }}
|
2023-10-09 15:42:51 +00:00
|
|
|
<script src="{{ $urlOpenapi }}" defer></script>
|
2024-04-03 21:30:51 +00:00
|
|
|
{{- $relOpenapi := replace $relOpenapi "swagger-ui-bundle" "swagger-ui" }}
|
|
|
|
{{- $relOpenapi := replace $relOpenapi ".js" ".css" }}
|
2023-10-09 15:42:51 +00:00
|
|
|
<script>
|
2024-07-04 06:23:54 +00:00
|
|
|
window.themeUseOpenapi = { css: {{ $relOpenapi }}, cssInProject: {{ $cssInProject | safeJS }}, assetsBuster: "{{ $assetBusting }}" };
|
2023-10-09 15:42:51 +00:00
|
|
|
</script>
|
2024-04-03 21:30:51 +00:00
|
|
|
{{- end }}
|
2023-10-09 15:42:51 +00:00
|
|
|
{{- end }}
|