| exampleSite/content/docs/compose/shortcodes.md | ●●●●● patch | view | raw | blame | history | |
| exampleSite/go.sum | ●●●●● patch | view | raw | blame | history | |
| layouts/shortcodes/liteyoutube.html | ●●●●● patch | view | raw | blame | history |
exampleSite/content/docs/compose/shortcodes.md
@@ -78,13 +78,15 @@ | params | YouTube parameters | yes | | img | Background image from static/images | yes | ##### With only `videoid` ##### With no Parameters This example shows only supplying the required `videoid` (without a named parameter). You can also add the `img` and `params` parameters (in that order) without using named parameters. ```markdown {{</* liteyoutube videoid="MmG2ah5Df4g" */>}} {{</* liteyoutube "MmG2ah5Df4g" */>}} ``` {{< liteyoutube videoid="MmG2ah5Df4g" >}} {{< liteyoutube "MmG2ah5Df4g" >}} ##### With `videoid` and `params` @@ -99,10 +101,10 @@ ##### With All Three Parameters ```markdown {{</* liteyoutube videoid="MmG2ah5Df4g" img="painting.jpg" params="controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" */>}} {{</* liteyoutube "MmG2ah5Df4g" "painting.jpg" "controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" */>}} ``` {{< liteyoutube videoid="MmG2ah5Df4g" img="painting.jpg" params="controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" >}} {{< liteyoutube "MmG2ah5Df4g" "painting.jpg" "controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" >}} {{< tip >}} You can browse the full list of YouTube parameters [here](https://developers.google.com/youtube/player_parameters#Parameters) exampleSite/go.sum
@@ -36,3 +36,5 @@ 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= github.com/rwstorer/hugo-theme-compose v0.0.0-20230611014843-d3652998710e h1:X7/nJFMOqLwYy0a/QPHDxQ1Mq6hJHNI+Tv8xWyBU9Bk= github.com/rwstorer/hugo-theme-compose v0.0.0-20230611014843-d3652998710e/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s= layouts/shortcodes/liteyoutube.html
@@ -1,7 +1,11 @@ {{ $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. --> {{ if $img }} {{ $bkImg := absURL (printf "images/%s" $img) }} {{ 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 }} <lite-youtube videoid="{{$videoid}}"{{ if $img }} style="background-image: url('{{$bkImg}}')"{{ end }}{{ if $params }} params="{{$params}}"{{ end }}></lite-youtube> {{ $bkImg := absURL (printf "images/%s" $img) }} <lite-youtube videoid="{{$videoid}}"{{ with $bkImg }} style="background-image: url('{{ . }}')"{{ end }}{{ with $params }} params="{{ . }}"{{ end }}></lite-youtube>