mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-14 10:54:40 -04:00
tpl: Add title parameter to YouTube shortcode
This commit is contained in:
parent
f5ccfbe982
commit
3ad4115ed8
@ -398,6 +398,13 @@ Furthermore, you can automatically start playback of the embedded video by setti
|
|||||||
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
For [accessibility reasons](https://dequeuniversity.com/tips/provide-iframe-titles), it's best to provide a title for your YouTube video. You can do this using the shortcode by providing a `title` parameter. If no title is provided, a default of "YouTube Video" will be used.
|
||||||
|
|
||||||
|
{{< code file="example-youtube-input-with-title.md" >}}
|
||||||
|
{{</* youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" */>}}
|
||||||
|
{{< /code >}}
|
||||||
|
|
||||||
|
|
||||||
#### Example `youtube` Output
|
#### Example `youtube` Output
|
||||||
|
|
||||||
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
|
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user