From a4be8b395bfc5eddee1687a4a04134fb93274858 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sat, 21 Jan 2023 21:32:02 -0600 Subject: [PATCH] Remove video and add remote-figure shortcodes --- layouts/shortcodes/figure.html | 7 +------ .../shortcodes/{image.html => remote-figure.html} | 2 +- layouts/shortcodes/video.html | 13 ------------- 3 files changed, 2 insertions(+), 20 deletions(-) rename layouts/shortcodes/{image.html => remote-figure.html} (74%) delete mode 100644 layouts/shortcodes/video.html diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 9d91d45..61d25d0 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -1,9 +1,4 @@ -{{ $resource := "" }} -{{ if .IsNamedParams }} - {{ $resource = $.Page.Resources.GetMatch (.Get "src") }} -{{ else }} - {{ $resource = $.Page.Resources.GetMatch (.Get 0) }} -{{ end }} +{{ $resource := .Page.Resources.GetMatch (.Get "src") }} {{ $noborder := false }} {{ if .Get "noborder" }} diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/remote-figure.html similarity index 74% rename from layouts/shortcodes/image.html rename to layouts/shortcodes/remote-figure.html index 480a9b0..4756e3c 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/remote-figure.html @@ -9,5 +9,5 @@ {{ end }}

- {{ partial "remote_figure.html" (dict "src" (.Get "src") "border" $border "hidecaption" $hidecaption "type" "image" "alt" (.Get "alt")) }} + {{ partial "remote_figure.html" (dict "src" (.Get "src") "border" $border "hidecaption" $hidecaption "type" (.Get "type") "alt" (.Get "alt")) }}

diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html deleted file mode 100644 index 27b6df8..0000000 --- a/layouts/shortcodes/video.html +++ /dev/null @@ -1,13 +0,0 @@ -{{ $border := false }} -{{ if .Get "border" }} - {{ $border = true }} -{{ end }} - -{{ $hidecaption := false }} -{{ if .Get "hidecaption" }} - {{ $hidecaption = true }} -{{ end }} - -

- {{ partial "remote_figure.html" (dict "src" (.Get "src") "border" $border "hidecaption" $hidecaption "type" "video" "alt" (.Get "alt")) }} -