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.
| | |
| | | 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= |
| | |
| | | {{ $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> |