diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b427ca..89e620c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# v4.1.0 +## 06/07/2021 + +1. [](#improved) + * Mentioned `shortcode-core` as required for shortcode syntax + * Added new `class` option for shortcode + * Added a new `.grav-youtube-wrapper` element for simpler targeting +1. [](#bugfix) + * Fixed padding to remove black bars at top and bottom [#34](https://github.com/getgrav/grav-plugin-youtube/pull/34) + + +# v4.0.0 +## 12/14/2020 + +1. [](#new) + * NextGen Editor shortcode support +1. [](#improved) + * Loop parameter fix for a single video [#36](https://github.com/getgrav/grav-plugin-youtube/pull/36) + # v3.1.0 ## 05/20/2020 diff --git a/README.md b/README.md index 31dfac7..cbb0908 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,9 @@ CSS is also loaded to provide the appropriate responsive layout. # Shortcode Syntax -As of version `3.0` you can now use an alternative _shortcode_ syntax that supports passing in the player parameter values inline +As of version `3.0` you can now use an alternative _shortcode_ syntax that supports passing in the player parameter values inline. + +**NOTE: `shortcode-core` plugin is required and must be installed and enabled for Shortcode Syntax to work.** ``` [youtube color=white autoplay=1]https://www.youtube.com/watch?v=BK8guP9ov2U[/youtube] diff --git a/blueprints.yaml b/blueprints.yaml index 5009377..11e66dc 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,7 @@ name: YouTube -version: 3.1.0 +slug: youtube +type: plugin +version: 4.1.0 description: "**YouTube** is a simple plugin that converts markdown links or shortcodes into responsive embeds." icon: youtube author: diff --git a/css/youtube.css b/css/youtube.css index d188840..4fdfa0f 100644 --- a/css/youtube.css +++ b/css/youtube.css @@ -1,7 +1,6 @@ .grav-youtube { height: 0; - padding-top: 25px; - padding-bottom: 56.34%; + padding-bottom: 56.25%; margin-bottom: 10px; position: relative; overflow: hidden; diff --git a/nextgen-editor/shortcodes/youtube/youtube.js b/nextgen-editor/shortcodes/youtube/youtube.js index e26c3bd..54a73c2 100644 --- a/nextgen-editor/shortcodes/youtube/youtube.js +++ b/nextgen-editor/shortcodes/youtube/youtube.js @@ -26,6 +26,12 @@ window.nextgenEditor.addShortcode('youtube', { widget: 'input-text', default: '', }, + class: { + type: String, + title: 'Class', + widget: 'input-text', + default: '', + }, autoplay: { type: Number, title: 'Autoplay', diff --git a/shortcodes/YoutubeShortcode.php b/shortcodes/YoutubeShortcode.php index 7199a10..55564d1 100644 --- a/shortcodes/YoutubeShortcode.php +++ b/shortcodes/YoutubeShortcode.php @@ -32,6 +32,7 @@ public function init() 'player_parameters' => $params, 'privacy_enhanced_mode' => $privacy_mode, 'video_id' => $matches[1], + 'class' => $sc->getParameter('class'), ); // check if size was given diff --git a/templates/partials/youtube.html.twig b/templates/partials/youtube.html.twig index c698b9b..57804ab 100644 --- a/templates/partials/youtube.html.twig +++ b/templates/partials/youtube.html.twig @@ -1,15 +1,17 @@ +
{% if lazy_load == true %} -
- - -
+
+ + +
{% else %} -
- -
-{% endif %} \ No newline at end of file +
+ +
+{% endif %} +
\ No newline at end of file