Add input errors for img, link, script

master
Will Faught 2 years ago
parent b728ac91a7
commit 01fe52fb53

@ -20,6 +20,10 @@
{{ $title := $params.title }} {{ $title := $params.title }}
{{ $width := $params.width }} {{ $width := $params.width }}
{{ if and (not $src) (not $resource) }}
{{ errorf "paige/img: no src or resource" }}
{{ end }}
{{ $intrinsicheight := $height }} {{ $intrinsicheight := $height }}
{{ $intrinsicwidth := $width }} {{ $intrinsicwidth := $width }}

@ -11,6 +11,10 @@
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }} {{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
{{ $sass := $params.sass }} {{ $sass := $params.sass }}
{{ if not $href }}
{{ errorf "paige/link: no href" }}
{{ end }}
{{ if not $raw }} {{ if not $raw }}
{{ $resource := partial "paige/resource.html" (dict {{ $resource := partial "paige/resource.html" (dict
"page" $page "page" $page

@ -9,6 +9,10 @@
{{ $raw := $params.raw }} {{ $raw := $params.raw }}
{{ $src := $params.src }} {{ $src := $params.src }}
{{ if not $src }}
{{ errorf "paige/script: no src" }}
{{ end }}
{{ if $raw }} {{ if $raw }}
{{ $src = $src }} {{ $src = $src }}
{{ else }} {{ else }}

Loading…
Cancel
Save