File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
theme-default/layouts/partials/components/c-video Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ disableHugoGeneratorInject: true
7
7
enableRobotsTXT : true
8
8
buildDrafts : true
9
9
languageCode : en
10
+ ignoreErrors :
11
+ - error-remote-getjson
10
12
defaultContentLanguage : en
11
13
defaultContentLanguageInSubdir : true
12
14
sitemap :
Original file line number Diff line number Diff line change 1
1
buildDrafts : false
2
+ ignoreErrors :
3
+ - error-remote-getjson
Original file line number Diff line number Diff line change 63
63
{{/* Build player url */}}
64
64
{{- $url := print "https://player.vimeo.com/video/" $video_id "?" (delimit $query "&") -}}
65
65
66
- {{/* Try to fetch thumbnail & title from vimeo oembed json */}}
66
+ {{/* Try getting thumbnail & title from Vimeo oEmbed endpoint */}}
67
67
{{- $poster_src := "" -}}
68
+
68
69
{{- with getJSON "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" $video_id }}
69
- {{/* Try get with & height from oembed to scale the thumbnail */}}
70
+ {{/* Access width & height from Vimeo embedcode to scale the thumbnail */}}
70
71
{{- $width := 0 -}}
71
72
{{- $height := 0 -}}
72
73
{{- $factor := 0 -}}
87
88
{{- with .title -}}
88
89
{{- $title = $title | default . -}}
89
90
{{- end -}}
90
- {{- end -}}
91
+ {{ else }}
92
+ {{/* Generate Embedcode failed, possibly due to invalid Vimeo source URL */}}
93
+ {{ warnf "Generating Vimeo embedcode failed" }}
94
+ < div > Generating Vimdeo embedcode failed. Please make sure to use a valid source URL.</ div >
95
+ {{ end }}
91
96
92
97
{{/* Generate srcdoc iframe placholder when autoplay is not enabled */}}
93
98
{{- $srcdoc := false -}}
You can’t perform that action at this time.
0 commit comments