diff --git a/layouts/shortcodes/iframe.html b/layouts/shortcodes/iframe.html index 8c677ee..7493248 100644 --- a/layouts/shortcodes/iframe.html +++ b/layouts/shortcodes/iframe.html @@ -1 +1,16 @@ - \ No newline at end of file + +{{ with .Get "src" }} + {{ $u := urls.Parse . }} + {{ if $u.IsAbs }} + {{ errorf "The src argument passed to the %q shortcode may not be an absolute URL. See %s" $.Name $.Position }} + {{ else }} + {{ with $.Page.Resources.Get $u.Path }} + {{ $src := (.Content | resources.FromString .Path).RelPermalink }} + + {{ else }} + {{ errorf "The %q shortcode was unable to find %s. See %s" $.Name $u.Path $.Position }} + {{ end }} + {{ end }} +{{ else }} + {{ errorf "The %q shortcode requires a src argument. See %s" .Name .Position }} +{{ end }} \ No newline at end of file