diff options
author | Andrew Zenk <andrew@andrewzenk.com> | 2020-12-02 05:53:53 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 12:53:53 +0100 |
commit | 4fc918e02cfc7f260d6312248ff9d33e95b27943 (patch) | |
tree | 64621d7e7e447b644c8456503e0648e6e8ed9a0e /docs/content | |
parent | 0ad378b09cea90a2a70d7ff06af668abe22475a1 (diff) |
tpl: Add title parameter to YouTube shortcode
Diffstat (limited to 'docs/content')
-rw-r--r-- | docs/content/en/content-management/shortcodes.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/content/en/content-management/shortcodes.md b/docs/content/en/content-management/shortcodes.md index a298bc425..2b4d0d632 100644 --- a/docs/content/en/content-management/shortcodes.md +++ b/docs/content/en/content-management/shortcodes.md @@ -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: |