mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
tpl/tplimpl: Change resources.GetRemote errors to suppressible warnings
Closes #13803
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
{{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
|
{{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
|
||||||
{{- with try (resources.GetRemote $request) -}}
|
{{- with try (resources.GetRemote $request) -}}
|
||||||
{{- with .Err -}}
|
{{- 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 -}}
|
{{- else with .Value -}}
|
||||||
{{- (. | transform.Unmarshal).html | safeHTML -}}
|
{{- (. | transform.Unmarshal).html | safeHTML -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
{{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
|
{{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
|
||||||
{{- with try (resources.GetRemote $request) -}}
|
{{- with try (resources.GetRemote $request) -}}
|
||||||
{{- with .Err -}}
|
{{- 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 -}}
|
{{- else with .Value -}}
|
||||||
{{- if not site.Config.Services.Twitter.DisableInlineCSS }}
|
{{- if not site.Config.Services.Twitter.DisableInlineCSS }}
|
||||||
{{- template "__h_simple_twitter_css" (dict "ctx" $.ctx) }}
|
{{- template "__h_simple_twitter_css" (dict "ctx" $.ctx) }}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
{{- $request := printf "https://vimeo.com/api/oembed.json?%s" $query -}}
|
{{- $request := printf "https://vimeo.com/api/oembed.json?%s" $query -}}
|
||||||
{{- with try (resources.GetRemote $request) -}}
|
{{- with try (resources.GetRemote $request) -}}
|
||||||
{{- with .Err -}}
|
{{- 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 -}}
|
{{- else with .Value -}}
|
||||||
{{- with . | transform.Unmarshal -}}
|
{{- with . | transform.Unmarshal -}}
|
||||||
{{- $class := printf "%s %s" "s_video_simple" "__h_video" -}}
|
{{- $class := printf "%s %s" "s_video_simple" "__h_video" -}}
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
{{- $request := printf "https://publish.x.com/oembed?%s" $query -}}
|
{{- $request := printf "https://publish.x.com/oembed?%s" $query -}}
|
||||||
{{- with try (resources.GetRemote $request) -}}
|
{{- with try (resources.GetRemote $request) -}}
|
||||||
{{- with .Err -}}
|
{{- 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 -}}
|
{{- else with .Value -}}
|
||||||
{{- (. | transform.Unmarshal).html | safeHTML -}}
|
{{- (. | transform.Unmarshal).html | safeHTML -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
{{- $request := printf "https://publish.x.com/oembed?%s" $query -}}
|
{{- $request := printf "https://publish.x.com/oembed?%s" $query -}}
|
||||||
{{- with try (resources.GetRemote $request) -}}
|
{{- with try (resources.GetRemote $request) -}}
|
||||||
{{- with .Err -}}
|
{{- 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 -}}
|
{{- else with .Value -}}
|
||||||
{{- if not site.Config.Services.X.DisableInlineCSS }}
|
{{- if not site.Config.Services.X.DisableInlineCSS }}
|
||||||
{{- template "__h_simple_x_css" (dict "ctx" $.ctx) }}
|
{{- template "__h_simple_x_css" (dict "ctx" $.ctx) }}
|
||||||
|
Reference in New Issue
Block a user