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

Ray
11.27.2023 1ae2e3d6a2af3b6175ff93ac27954b5cda9572c7
layouts/shortcodes/liteyoutube.html
@@ -3,17 +3,25 @@
  {{ $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" $img) }} {{ end }}
  <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
  {{ printf "img = [{{$img}}]" }}
  {{ printf "bkImg = [{{$bkImg}}]" }}
  {{ with $img }}
    {{ $bkImg := absURL (printf "images/%s" $img) }}
    {{ printf "named img = [%s]" $img }}
    {{ printf "named bkImg = [%s]" $bkImg}}
    <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" $img) }} {{ end }}
  <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>
  {{ printf "img = [%s]" $img }}
  {{ printf "bkImg = [%s]" $bkImg }}
  {{ with $img }}
    {{ $bkImg := absURL (printf "images/%s" $img) }}
    {{ printf "pos img = [%s]" $img }}
    {{ printf "pos bkImg = [%s]" $bkImg}}
    <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 }}