mirror of
https://github.com/getzola/zola
synced 2024-11-10 14:24:27 +00:00
Support embed YouTube playlist (#1342)
This commit is contained in:
parent
a65a2d52c7
commit
3cb61c3bcd
2 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,3 @@
|
|||
<div {% if class %}class="{{class}}"{% endif %}>
|
||||
<iframe src="https://www.youtube-nocookie.com/embed/{{id}}{% if autoplay %}?autoplay=1{% endif %}" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
||||
<iframe src="https://www.youtube-nocookie.com/embed/{{id}}{% if playlist %}?list={{playlist}}{% endif %}{% if autoplay %}?autoplay=1{% endif %}" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
||||
</div>
|
||||
|
|
|
@ -164,6 +164,7 @@ Embed a responsive player for a YouTube video.
|
|||
The arguments are:
|
||||
|
||||
- `id`: the video id (mandatory)
|
||||
- `playlist: the playlist id (optional)
|
||||
- `class`: a class to add to the `<div>` surrounding the iframe
|
||||
- `autoplay`: when set to "true", the video autoplays on load
|
||||
|
||||
|
@ -172,6 +173,8 @@ Usage example:
|
|||
```md
|
||||
{{/* youtube(id="dQw4w9WgXcQ") */}}
|
||||
|
||||
{{/* youtube(id="dQw4w9WgXcQ", playlist="RDdQw4w9WgXcQ") */}}
|
||||
|
||||
{{/* youtube(id="dQw4w9WgXcQ", autoplay=true) */}}
|
||||
|
||||
{{/* youtube(id="dQw4w9WgXcQ", autoplay=true, class="youtube") */}}
|
||||
|
|
Loading…
Reference in a new issue