mirror of https://github.com/onweru/compose.git

Ray
11.28.2023 cdec55a137705c12ed0c5738680b0deacb5b5807
1
2
3
4
5
6
7
8
9
10
11
{{ if .IsNamedParams }} <!-- check if using named parameters or not -->
  {{ $videoid := .Get "videoid" }} <!-- required. -->
  {{ $img := .Get "img" }} <!-- not required. The initial background image instead of a generated one. -->
  {{ $params := .Get "params" }} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters -->
{{ else }}
  {{ $videoid := .Get 0 }} <!-- required. -->
  {{ $img := .Get 1 }} <!-- not required. The initial background image instead of a generated one. -->
  {{ $params := .Get 2 }} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters -->
{{ end }}
{{ with $img }} {{ $bkImg := absURL (printf "images/%s" $img) }} {{ end }}
<lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>