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

Ray
11.38.2023 fa22efc00a50fbd9758ec39e31cef1d7f8884b89
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{{ if .IsNamedParams }}
  {{ $videoid := .Get "videoid" }} <!-- required. -->
  {{ $img := .Get "img" }} <!-- not required. The initial background image instead of a generated one. -->
  {{ $bkImg := "" }}
  {{ $params := .Get "params" }} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters -->
  {{ with $img }}
    {{ $bkImg := absURL (printf "images/%s" .) }}
    <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
  {{ else }}
    <lite-youtube videoid="{{$videoid}}"{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
  {{ end }}
{{ 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 -->
  {{ $bkImg := "" }}
  {{ with $img }}
    {{ $bkImg := absURL (printf "images/%s" .) }}
    <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
  {{ else }}
    <lite-youtube videoid="{{$videoid}}"{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
  {{ end }}
{{ end }}