| exampleSite/content/docs/compose/shortcodes.md | ●●●●● patch | view | raw | blame | history | |
| exampleSite/go.mod | ●●●●● 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
@@ -70,18 +70,21 @@ #### Lite YouTube The `liteyoutube` shortcode supports two parameters: The `liteyoutube` shortcode supports three parameters: - videoid: the `videoid` parameter **is required**. However, you don't have to use it by name--you can just put in a YouTube video ID. - params: the `params` parameter is **not** required. If you decide to use it, you must also use the `videoid` parameter. | PARAMETER | PURPOSE | OPTIONAL | | :--- | :--- | :--- | | videoid | YouTube video identifier | no | | params | YouTube parameters | yes | | img | Background image from static/images | yes | ##### Without `videoid` ##### With only `videoid` ```markdown {{</* liteyoutube "MmG2ah5Df4g" */>}} {{</* liteyoutube videoid="MmG2ah5Df4g" */>}} ``` {{< liteyoutube "MmG2ah5Df4g" >}} {{< liteyoutube videoid="MmG2ah5Df4g" >}} ##### With `videoid` and `params` @@ -93,6 +96,15 @@ {{< liteyoutube videoid="MmG2ah5Df4g" params="controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" >}} ##### 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 videoid="MmG2ah5Df4g" img="painting.jpg" params="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) {{< /tip >}} exampleSite/go.mod
@@ -2,4 +2,7 @@ go 1.15 require github.com/onweru/compose v0.0.0-20230530114506-a2ddf2b32939 // indirect require ( github.com/onweru/compose v0.0.0-20230530114506-a2ddf2b32939 // indirect github.com/rwstorer/hugo-theme-compose v0.0.0-20230611001648-0f1fb40e912e // indirect ) exampleSite/go.sum
@@ -28,3 +28,5 @@ github.com/onweru/compose v0.0.0-20230522093958-40f93a906ddc/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= github.com/onweru/compose v0.0.0-20230530114506-a2ddf2b32939 h1:XVZlCIf6BUmHReHKp5bt/e4+Vy5NCypqiju/LEcCz4Y= github.com/onweru/compose v0.0.0-20230530114506-a2ddf2b32939/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= github.com/rwstorer/hugo-theme-compose v0.0.0-20230611001648-0f1fb40e912e h1:EaCAVi8vhFZzgejGR5pf1MJPl+YC6SY+dgEkckbWyHc= github.com/rwstorer/hugo-theme-compose v0.0.0-20230611001648-0f1fb40e912e/go.mod h1:7TS3BoBV/IcLPRT2r7LyTyOqzsS5P5sXKlNpGgxdK/s= layouts/shortcodes/liteyoutube.html
@@ -1,10 +1,4 @@ {{ $videoid := .Get "videoid" }} {{ if not $videoid }} {{ $videoid := .Get 0 }} {{ if not $videoid }} {{ errorf "'videoid' parameter required!" }} {{ end }} {{ end }} {{ $params := .Get "params" }} <!-- not required. List of params here: https://developers.google.com/youtube/player_parameters --> <lite-youtube videoid="{{ $videoid }}"{{ if $params }} params="{{$params}}"{{ end }}></lite-youtube> {{ $img := .Get "img"}} <!-- not required. The initial background image instead of a generated one. --> <lite-youtube videoid="{{$videoid}}"{{ if $img }} style="background-image: url('/images/{{$img}}`)"{{ end }}{{ if $params }} params="{{$params}}"{{ end }}></lite-youtube>