summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/img.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/img.html')
-rw-r--r--layouts/shortcodes/img.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
new file mode 100644
index 0000000..40002cf
--- /dev/null
+++ b/layouts/shortcodes/img.html
@@ -0,0 +1,34 @@
+<!--
+ class: class of figure
+ link: url of image
+ id: id of image
+ alt: alt text
+ caption: caption
+ mouse: text when moused over
+ width: fixed width (ex: 600px, 80%)
+ maxwidth: max width (ex: 800px)
+-->
+
+<figure {{ with .Get "class" }}class="{{.}}"{{ end -}}>
+ {{- with .Get "link"}}<a href="{{.}}">{{ end -}}
+ <img
+ src="{{ .Get "src" }}"
+ {{- with .Get "mouse" }} title="{{.}}"{{ end -}}
+ {{- with .Get "id" }} id="{{.}}"{{ end -}}
+ {{- with .Get "alt" }} alt="{{.}}"{{ end -}}
+ {{- if or (.Get "width") (.Get "maxwidth") }}
+ style="
+ {{- with .Get "width" }}width: {{.}};{{ end -}}
+ {{- with .Get "maxwidth" }}max-width: {{.}};{{ end -}}
+ height: auto;
+ "
+ {{- end -}}
+ >
+ {{- if .Get "link"}}</a>{{ end -}}
+
+ {{- with .Get "caption" -}}
+ <figcaption>
+ {{- . -}}
+ </figcaption>
+ {{- end -}}
+</figure>