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

Ray
11.47.2023 0e37d8ea2e7fc68859be9ce5b1dabaaca65309fa
added bkImg var

Modified:
- layouts/shortcodes/liteyoutube.html

I made another syntax error. I decided to add another variable to avoid doing too much in a single command.
2 files modified
7 ■■■■ changed files
exampleSite/go.sum 2 ●●●●● patch | view | raw | blame | history
layouts/shortcodes/liteyoutube.html 5 ●●●● patch | view | raw | blame | history
exampleSite/go.sum
@@ -34,3 +34,5 @@
github.com/rwstorer/hugo-theme-compose v0.0.0-20230611011250-29764d3cdc54/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
github.com/rwstorer/hugo-theme-compose v0.0.0-20230611013609-aeaea2852b98 h1:9pYay6P/mUgA31ANPqFQBjGI809JhN1Li/umaFeFhIE=
github.com/rwstorer/hugo-theme-compose v0.0.0-20230611013609-aeaea2852b98/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
github.com/rwstorer/hugo-theme-compose v0.0.0-20230611013841-e25e31add480 h1:m+9tc/4S8keQy3IhvdtzlZf0T2rW8LIHBkTD6qS40kM=
github.com/rwstorer/hugo-theme-compose v0.0.0-20230611013841-e25e31add480/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s=
layouts/shortcodes/liteyoutube.html
@@ -1,4 +1,7 @@
{{ $videoid := .Get "videoid" }}
{{ $params := .Get "params" }} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters -->
{{ $img := .Get "img"}} <!-- not required. The initial background image instead of a generated one. -->
<lite-youtube videoid="{{$videoid}}"{{ if $img }} style="background-image: url('{{absURL (printf `images/%s` $img)}}`)"{{ end }}{{ if $params }} params="{{$params}}"{{ end }}></lite-youtube>
{{ if $img }}
  {{ $bkImg := absURL (printf "images/%s" $img) }}
{{ end }}
<lite-youtube videoid="{{$videoid}}"{{ if $img }} style="background-image: url('{{$bkImg}}')"{{ end }}{{ if $params }} params="{{$params}}"{{ end }}></lite-youtube>