From 29764d3cdc54e0f25f2c2f377f72eeebf1535dab Mon Sep 17 00:00:00 2001
From: Ray <rwstorer@hotmail.com>
Date: Sun, 11 Jun 2023 01:12:50 +0000
Subject: [PATCH] updated docs and added img

---
 layouts/shortcodes/liteyoutube.html            |   10 ++--------
 exampleSite/go.mod                             |    5 ++++-
 exampleSite/content/docs/compose/shortcodes.md |   24 ++++++++++++++++++------
 exampleSite/go.sum                             |    2 ++
 4 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/exampleSite/content/docs/compose/shortcodes.md b/exampleSite/content/docs/compose/shortcodes.md
index e9e36be..b9a64d7 100644
--- a/exampleSite/content/docs/compose/shortcodes.md
+++ b/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 >}}
diff --git a/exampleSite/go.mod b/exampleSite/go.mod
index e395a91..d68440d 100644
--- a/exampleSite/go.mod
+++ b/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
+)
diff --git a/exampleSite/go.sum b/exampleSite/go.sum
index c41c08e..2e7723d 100644
--- a/exampleSite/go.sum
+++ b/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=
diff --git a/layouts/shortcodes/liteyoutube.html b/layouts/shortcodes/liteyoutube.html
index 0bb7c2e..bc56b49 100644
--- a/layouts/shortcodes/liteyoutube.html
+++ b/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>
\ No newline at end of file
+{{ $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>
\ No newline at end of file

--
Gitblit v1.10.0