From 5dc76c6ec1d8a77f07c73b61a57be6879c308c26 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Thu, 2 Mar 2023 23:03:09 -0800 Subject: [PATCH] Separate youtube and figure shortcodes --- README.md | 2 -- layouts/partials/paige/style.html | 8 +++++++ layouts/shortcodes/paige/youtube.html | 30 +++++++-------------------- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index c84b5680..ce95be89 100644 --- a/README.md +++ b/README.md @@ -656,8 +656,6 @@ Parameters:
Optional. Position 0. String. Video ID.
-It has the parameters of the `paige/figure` shortcode. - ## Customize ### Include diff --git a/layouts/partials/paige/style.html b/layouts/partials/paige/style.html index ac878c64..0671273a 100644 --- a/layouts/partials/paige/style.html +++ b/layouts/partials/paige/style.html @@ -47,6 +47,10 @@ body, html { margin-bottom: 0; } +.paige-figure .paige-video { + margin-bottom: 0; +} + .paige-figure > div > .highlight > pre, .paige-figure > div > :last-child { margin-bottom: 0; } @@ -79,6 +83,10 @@ body, html { transition: color 0.15s ease-in-out, opacity 0.15s ease-in-out; } +.paige-video { + margin-bottom: 1rem; +} + @media (prefers-reduced-motion: reduce) { .paige-header-link { transition: none; diff --git a/layouts/shortcodes/paige/youtube.html b/layouts/shortcodes/paige/youtube.html index 94e90e4a..5ff73cc8 100644 --- a/layouts/shortcodes/paige/youtube.html +++ b/layouts/shortcodes/paige/youtube.html @@ -1,21 +1,15 @@ {{ $autoplay := .Get "autoplay" }} -{{ $caption := .Get "caption" }} {{ $controls := .Get "controls" | default true }} {{ $description := .Get "description" | default "YouTube video" }} {{ $end := .Get "end" }} -{{ $float := .Get "float" }} {{ $fullscreen := .Get "fullscreen" | default true }} {{ $height := .Get "height" }} -{{ $horizontal := .Get "horizontal" }} {{ $list := .Get "list" }} {{ $loop := .Get "loop" }} {{ $maxwidth := .Get "maxwidth" }} {{ $mute := .Get "mute" }} -{{ $number := .Get "number" }} -{{ $numbered := .Get "numbered" }} {{ $referrerpolicy := .Get "referrerpolicy" | default "no-referrer-when-downgrade" }} {{ $start := .Get "start" }} -{{ $vertical := .Get "vertical" }} {{ $video := .Get 0 | default (.Get "video") | default "dQw4w9WgXcQ" }} {{ $width := .Get "width" }} @@ -71,21 +65,11 @@ {{ $src = print $src "?" . }} {{ end }} -{{ partial "paige/figure.html" (dict - "caption" $caption - "content" (partial "paige/video.html" (dict - "fullscreen" $fullscreen - "height" $height - "referrerpolicy" $referrerpolicy - "src" $src - "title" $description - "width" $width - )) - "float" $float - "gap" 2 - "horizontal" $horizontal - "maxwidth" $maxwidth - "number" $number - "numbered" $numbered - "vertical" $vertical +{{ partial "paige/video.html" (dict + "fullscreen" $fullscreen + "height" $height + "referrerpolicy" $referrerpolicy + "src" $src + "title" $description + "width" $width ) }}