diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 8c29faa3..9dc2d3c3 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -738,17 +738,39 @@ consectetur adipiscing elit. A shortcut to embed youtube videos using the [lite-youtube-embed](https://github.com/paulirish/lite-youtube-embed) library. This library is a lightweight alternative to the standard youtube embeds, and it's designed to be faster and more efficient. -| Parameter | Description | -| --------- | ----------------------------------- | -| `id` | [String] Youtube video id to embed. | -| `label` | [String] Label for the video | +| Parameter | Description | +| --------- | -------------------------------------------- | +| `id` | [String] Youtube video id to embed. | +| `label` | [String] Label for the video | +| `params` | [String] Extras parameters for video playing | **Example 1:** ```md {{}} - ``` {{< youtubeLite id="SgXhGb-7QbU" label="Blowfish-tools demo" >}} + +**Example 2:** + +You can use all of Youtube's [player parameters](https://developers.google.com/youtube/player_parameters#Parameters) for the `params` variable, as demonstrated below: + +> This video will start after 130 seconds (2m10) + +```md +{{}} +``` + +> This video will not have UI controls, will start playing at 130 seconds and will stop 10 seconds later. + +To concatenate multiple options as shown below, you need to add the `&` character between them. + +```md +{{}} +``` + +{{}} + +More informations can be found on the [youtubeLite GitHub repo](https://github.com/paulirish/lite-youtube-embed/blob/master/readme.md#custom-player-parameters) and Youtube's [player parameters](https://developers.google.com/youtube/player_parameters#Parameters) page. diff --git a/layouts/shortcodes/youtubeLite.html b/layouts/shortcodes/youtubeLite.html index 398f9f79..4375eb38 100644 --- a/layouts/shortcodes/youtubeLite.html +++ b/layouts/shortcodes/youtubeLite.html @@ -1,4 +1,5 @@ {{- $id := .Get "id" | default "SgXhGb-7QbU" -}} {{- $label := .Get "id" | default "Blowfish" -}} +{{- $params := .Get "params" -}} - +