diff --git a/layouts/shortcodes/fig.html b/layouts/shortcodes/fig.html
index b8e71e3..314bc45 100644
--- a/layouts/shortcodes/fig.html
+++ b/layouts/shortcodes/fig.html
@@ -1,15 +1,22 @@
+{{ $fig := newScratch }}
+{{ if .Get "caption" }}
+ {{ $fig.Set "caption" (.Get "caption") }}
+{{ else if .Get "alt" }}
+ {{ $fig.Set "caption" (.Get "alt") }}
+{{ end }}
+{{ .Page.Scratch.Add "fig" 1 }}
+{{ $fig.Delete "caption"}}
\ No newline at end of file