]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl/tplimpl: Change resources.GetRemote errors to suppressible warnings
authorJoe Mooring <joe@mooring.com>
Tue, 17 Jun 2025 14:35:14 +0000 (07:35 -0700)
committerGitHub <noreply@github.com>
Tue, 17 Jun 2025 14:35:14 +0000 (07:35 -0700)
Closes #13803

tpl/tplimpl/embedded/templates/_shortcodes/twitter.html
tpl/tplimpl/embedded/templates/_shortcodes/twitter_simple.html
tpl/tplimpl/embedded/templates/_shortcodes/vimeo_simple.html
tpl/tplimpl/embedded/templates/_shortcodes/x.html
tpl/tplimpl/embedded/templates/_shortcodes/x_simple.html

index 849bad99efd14b1ac7d8b11f10ffe836fc39ec79..c6200ffd279d99331f4291375e9a37689c736efb 100644 (file)
@@ -20,7 +20,7 @@
   {{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
   {{- with try (resources.GetRemote $request) -}}
     {{- with .Err -}}
-      {{- errorf "%s" . -}}
+      {{- warnidf "shortcode-twitter-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
     {{- else with .Value -}}
       {{- (. | transform.Unmarshal).html | safeHTML -}}
     {{- else -}}
index e9dcc76ba9867e11595699d58b80ccd547884d05..34150393d06bc4a1962aa154202ffda381502e76 100644 (file)
@@ -16,7 +16,7 @@
   {{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
   {{- with try (resources.GetRemote $request) -}}
     {{- with .Err -}}
-      {{- errorf "%s" . -}}
+      {{- warnidf "shortcode-twitter-simple-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
     {{- else with .Value -}}
       {{- if not site.Config.Services.Twitter.DisableInlineCSS }}
         {{- template "__h_simple_twitter_css" (dict "ctx" $.ctx) }}
index 2e5f882829c3c98a2199ab61ca898b3c8140505e..a00f3e7f61192e0307e58660b87d395fcf307f1b 100644 (file)
@@ -25,7 +25,7 @@
   {{- $request := printf "https://vimeo.com/api/oembed.json?%s" $query -}}
   {{- with try (resources.GetRemote $request) -}}
     {{- with .Err -}}
-      {{- errorf "%s" . -}}
+      {{- warnidf "shortcode-vimeo-simple" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
     {{- else with .Value -}}
       {{- with . | transform.Unmarshal -}}
         {{- $class := printf "%s %s" "s_video_simple" "__h_video" -}}
index 87455530c5e8b65961de79b85faad2011c7d0427..38bf0f7b60aecec07453771d97f6c698cc474ebc 100644 (file)
@@ -19,7 +19,7 @@
   {{- $request := printf "https://publish.x.com/oembed?%s" $query -}}
   {{- with try (resources.GetRemote $request) -}}
     {{- with .Err -}}
-      {{- errorf "%s" . -}}
+      {{- warnidf "shortcode-x-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
     {{- else with .Value -}}
       {{- (. | transform.Unmarshal).html | safeHTML -}}
     {{- else -}}
index be7830668b5c8a3478a976b07051ad7ef75288b5..1e22835f69f37049188a692e642d255086365fc8 100644 (file)
@@ -15,7 +15,7 @@
   {{- $request := printf "https://publish.x.com/oembed?%s" $query -}}
   {{- with try (resources.GetRemote $request) -}}
     {{- with .Err -}}
-      {{- errorf "%s" . -}}
+      {{- warnidf "shortcode-x-simple-getremote" "The %q shortcode was unable to retrieve the remote data: %s. See %s" $.ctx.Name . $.ctx.Position -}}
     {{- else with .Value -}}
       {{- if not site.Config.Services.X.DisableInlineCSS }}
         {{- template "__h_simple_x_css" (dict "ctx" $.ctx) }}