mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
tpl: Add title parameter to YouTube shortcode
This commit is contained in:
@@ -398,6 +398,13 @@ Furthermore, you can automatically start playback of the embedded video by setti
|
||||
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
||||
{{< /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
|
||||
|
||||
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
|
||||
|
Reference in New Issue
Block a user