Refactor YouTube shortcode

Includes the following changes:
 - Add support to retrieve the YouTube title from the video metadata
 - Adjusts autoplay configuration
 - Improve argument handling
This commit is contained in:
Mark Dumay
2024-08-11 12:05:48 +02:00
parent e99ac83fbc
commit fb20543d88
3 changed files with 67 additions and 20 deletions

View File

@@ -466,3 +466,13 @@ As an example, the following shortcode displays a tooltip for a colored hyperlin
{{</* tooltip color="primary" title="Tooltip caption" href="#!" */>}}Tooltip{{</* /tooltip */>}} demonstration
{{< /example >}}
<!-- markdownlint-enable MD037 -->
## Youtube
As an example, the following shortcode displays a Hugo quickstart guide.
<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* youtube id="w7Ft2ymGmfc" autoplay=true autotitle=true */>}}
{{< /example >}}
<!-- markdownlint-enable MD037 -->