diff --git a/layouts/_markup/render-image.html b/layouts/_markup/render-image.html
index 42e9213..6f83f10 100644
--- a/layouts/_markup/render-image.html
+++ b/layouts/_markup/render-image.html
@@ -1,8 +1,12 @@
+{{/* TODO: should we use .PageInner */}}
+{{ partial "embed-resource.html" (.Page.Resources.Get .Destination) }}
{{ with .Title }}
-
- {{ partial "embed-resource.html" ($.Page.Resources.Get $.Destination) }}
- {{ . }}
-
-{{ else }}
- {{ partial "embed-resource.html" (.Page.Resources.Get .Destination) }}
+ {{ errorf "%q" . }}
+{{ end }}
+{{ with .Attributes }}
+ {{/* FIXME: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_markup/render-image.html */}}
+ {{ errorf "%q" . }}
+{{ end }}
+{{ with .Text }}
+ {{ errorf "%q" . }}
{{ end }}
diff --git a/layouts/_shortcodes/figure.html b/layouts/_shortcodes/figure.html
index 96c1b38..8bac195 100644
--- a/layouts/_shortcodes/figure.html
+++ b/layouts/_shortcodes/figure.html
@@ -1,8 +1,17 @@
-
-
+
+ {{ with .Get "src" }}
+ {{ with $.Page.Resources.Get . }}
+ {{ partial "embed-resource.html" . }}
+ {{ with .Title }}
+ {{ . | markdownify }}
+ {{ end }}
+ {{ else }}
+ {{ errorf "resource %q not found" . }}
+ {{ end }}
+ {{ else }}
{{ .Inner }}
{{ with .Get "caption" }}
- {{ . }}
+ {{ . | markdownify }}
{{ end }}
-
-
+ {{ end }}
+
diff --git a/layouts/_shortcodes/resource.html b/layouts/_shortcodes/resource.html
new file mode 100644
index 0000000..c223dd7
--- /dev/null
+++ b/layouts/_shortcodes/resource.html
@@ -0,0 +1,9 @@
+{{ with .Get 0 }}
+ {{ with $.Page.Resources.Get . }}
+ {{ partial "embed-resource.html" . }}
+ {{ else }}
+ {{ errorf "resource %q not found" . }}
+ {{ end }}
+{{ else }}
+ {{ errorf "resource name not provided as first parameter" }}
+{{ end }}