aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-04-17 14:22:38 +0200
committerBjørn Erik Pedersen <[email protected]>2024-04-18 10:02:36 +0200
commit0c188fda24f6a521ad2b5bbad8f2de910cd52414 (patch)
tree70d6686f067e680a9dba38fb40c0bff27aeac691 /tpl
parentbbc6888d026cc08d0c47018656a64f4301bdef18 (diff)
downloadhugo-0c188fda24f6a521ad2b5bbad8f2de910cd52414.tar.gz
hugo-0c188fda24f6a521ad2b5bbad8f2de910cd52414.zip
tpl: Use erroridf for remote YouTube errors
So they can be silenced. Fixes #12383
Diffstat (limited to 'tpl')
-rw-r--r--tpl/tplimpl/embedded/templates/shortcodes/youtube.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/tpl/tplimpl/embedded/templates/shortcodes/youtube.html b/tpl/tplimpl/embedded/templates/shortcodes/youtube.html
index a9533b95e..bf72be45b 100644
--- a/tpl/tplimpl/embedded/templates/shortcodes/youtube.html
+++ b/tpl/tplimpl/embedded/templates/shortcodes/youtube.html
@@ -22,6 +22,7 @@ Renders an embedded YouTube video.
*/}}
{{- $pc := .Page.Site.Config.Privacy.YouTube }}
+{{- $remoteErrID := "err-youtube-remote" }}
{{- if not $pc.Disable }}
{{- with $id := or (.Get "id") (.Get 0) }}
@@ -31,12 +32,12 @@ Renders an embedded YouTube video.
{{- $data := dict }}
{{- with resources.GetRemote $url }}
{{- with .Err }}
- {{- errorf "The %q shortcode was unable to get remote resource %q. %s. See %s" $.Name $url . $.Position }}
+ {{- erroridf $remoteErrID "The %q shortcode was unable to get remote resource %q. %s. See %s" $.Name $url . $.Position }}
{{- else }}
{{- $data = .Content | transform.Unmarshal }}
{{- end }}
{{- else }}
- {{- errorf "The %q shortcode was unable to get remote resource %q. See %s" $.Name $url $.Position }}
+ {{- erroridf $remoteErrID "The %q shortcode was unable to get remote resource %q. See %s" $.Name $url $.Position }}
{{- end }}
{{/* Set defaults. */}}