From 0c5d533b40f92fa4a8204ca8f3475d1618459b31 Mon Sep 17 00:00:00 2001 From: Colin Sullender Date: Tue, 30 Apr 2024 12:53:12 -0600 Subject: [PATCH] Fix broken iframe --- layouts/shortcodes/iframe.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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