mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-12-04 21:23:07 +00:00
22 lines
No EOL
758 B
HTML
22 lines
No EOL
758 B
HTML
{{- $page := .page }}
|
|
{{- if and (not $page) .context }}
|
|
{{- $page = .context }}
|
|
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'openapi' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Filename }}
|
|
{{- end }}
|
|
{{- $src := .src }}
|
|
{{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $page) .id }}
|
|
{{- with $page }}
|
|
{{- with .Resources.Match $src }}
|
|
{{- range . }}
|
|
{{- $src = .RelPermalink }}
|
|
{{- end }}
|
|
{{- end }}
|
|
<div class="sc-openapi-wrapper is-loading helper-loading-container">
|
|
<div
|
|
class="sc-openapi-container"
|
|
id="R-openapi-{{ $id }}"
|
|
data-openapi-url="{{ $src }}"
|
|
></div>
|
|
</div>
|
|
{{- .Store.Set "hasOpenApi" true }}
|
|
{{- end }} |