diff --git a/assets/css/bobastyle.css b/assets/css/bobastyle.css
index 31b2018..9aa7a8c 100644
--- a/assets/css/bobastyle.css
+++ b/assets/css/bobastyle.css
@@ -112,7 +112,7 @@ img, video {
max-width: 100%;
}
-img:not(.noborder), video:not(.noborder) {
+figure.border img, figure.border video {
padding: 5px;
border: 7px solid #1b5b9b;
}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index dbdae26..55c4658 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -19,7 +19,7 @@
{{ with .Resources.GetMatch "feature" }}
- {{ partial "figure.html" . }}
+ {{ partial "figure.html" (dict "src" . "border" true) }}
{{ end }}
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html
index 78af37d..3027e3c 100644
--- a/layouts/_default/summary.html
+++ b/layouts/_default/summary.html
@@ -13,7 +13,7 @@
{{ with .Resources.GetMatch "feature" }}
- {{ partial "figure.html" . }}
+ {{ partial "figure.html" (dict "src" . "border" true) }}
{{ end }}
diff --git a/layouts/partials/figure.html b/layouts/partials/figure.html
index 1d0804f..8e04af5 100644
--- a/layouts/partials/figure.html
+++ b/layouts/partials/figure.html
@@ -1,4 +1,12 @@
+{{ $hidecaption := index . "hidecaption" }}
+
+{{ if index . "border" }}
+
+{{ else }}
+{{ end }}
+ {{ with index . "src" }}
+
{{ $media := . | resources.Fingerprint "sha512" }}
{{ if eq .MediaType.MainType "image" }}
@@ -9,9 +17,13 @@
{{ end }}
+ {{ if not $hidecaption }}
{{ with $media.Title }}
{{ . | markdownify }}
{{ end }}
+ {{ end }}
+
+ {{ end }}
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html
index d364561..5eb286d 100644
--- a/layouts/shortcodes/figure.html
+++ b/layouts/shortcodes/figure.html
@@ -1,2 +1,15 @@
{{ $resource := $.Page.Resources.GetMatch (.Get "src") }}
-{{ partial "figure.html" $resource }}
+
+{{ $border := false }}
+{{ if .Get "border" }}
+{{ $border = true }}
+{{ end }}
+
+{{ $hidecaption := false }}
+{{ if .Get "hidecaption" }}
+{{ $hidecaption = true }}
+{{ end }}
+
+
+ {{ partial "figure.html" (dict "src" $resource "border" $border "hidecaption" $hidecaption) }}
+