mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 09:43:06 +00:00
31 lines
No EOL
1.6 KiB
HTML
31 lines
No EOL
1.6 KiB
HTML
{{- $page := .page }}
|
|
{{- $location := .location }}
|
|
{{- if eq $location "footer" }}
|
|
{{- with $page }}
|
|
{{- $assetBusting := partialCached "_relearn/assetbusting.gotmpl" . }}
|
|
<script src="{{"js/js-yaml.min.js" | relURL}}{{ $assetBusting }}" defer></script>
|
|
{{- $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 }}
|
|
{{- $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 }}
|
|
{{- $cssInProject = true }}
|
|
{{- end }}
|
|
<script>window.noZensmooth = true;</script>
|
|
<script src="{{ $urlOpenapi }}" defer></script>
|
|
{{- $urlOpenapi := replace $urlOpenapi "swagger-ui-bundle" "swagger-ui-standalone-preset" }}
|
|
<script src="{{ $urlOpenapi }}" defer></script>
|
|
{{- $relOpenapi := replace $relOpenapi "swagger-ui-bundle" "swagger-ui" }}
|
|
{{- $relOpenapi := replace $relOpenapi ".js" ".css" }}
|
|
<script>
|
|
window.themeUseOpenapi = { css: {{ $relOpenapi }}, cssInProject: {{ $cssInProject | safeJS }}, assetsBuster: "{{ $assetBusting }}" };
|
|
</script>
|
|
{{- end }}
|
|
{{- end }} |