{{- /* This shortcode allows you to create a simulation of an OS interface window. @param {string} title Window title. @param {string} icon Window icon. @param {string} type [primary|secondary|success|danger|warning|info|light|dark] Window type. @returns {template.HTML} @examples {{< window title="Hello World!" icon="fas fa-computer" >}} Application failed to start because no Qt platform plugin could be initialized. {{< /window >}} */ -}} {{ $title := ((.Get "title") | default (i18n "sc.window.title")) }} {{ $icon := ((.Get "icon") | default "fas fa-computer") }} {{ $type := (.Get "type") }} {{ $types := (slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark") }} {{ with ($type) }} {{ if (not (in ($types) .)) }} {{ (errorf "The type passed to the %q shortcode is invalid. The type must be one of %s. See %s." ($.Name) (delimit ($types) ", " ", or ") ($.Position)) }} {{ end }} {{ end }} {{ with ($type) }}{{ $type = (printf "text-bg-%s" .) }}{{ end }}
{{ ($title) }}
{{ with (.Inner) }}{{ (. | $.Page.RenderString (dict "display" "block")) }}{{ end }}