diff --git a/layouts/partials/remote_figure.html b/layouts/partials/remote_figure.html new file mode 100644 index 0000000..1a61823 --- /dev/null +++ b/layouts/partials/remote_figure.html @@ -0,0 +1,27 @@ +{{ $hidecaption := index . "hidecaption" }} +{{ $type := index . "type" }} +{{ $src := index . "src" }} +{{ $alt := index . "alt" }} + +{{ if index . "border" }} +
+{{ else }} +
+{{ end }} + {{ if eq $type "image" }} + {{ $alt }} + {{ else if eq $type "video" }} + + {{ end }} + + {{ if not $hidecaption }} + {{ with $alt }} +
+ {{ . | markdownify }} +
+ {{ end }} + {{ end }} +
diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html new file mode 100644 index 0000000..e442c1e --- /dev/null +++ b/layouts/shortcodes/image.html @@ -0,0 +1,13 @@ +{{ $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" "image" "alt" (.Get "alt")) }} +

diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 0000000..1f18685 --- /dev/null +++ b/layouts/shortcodes/video.html @@ -0,0 +1,13 @@ +{{ $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")) }} +