Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zhaohuabing/hugo-theme-cleanwhite.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhuabing zhao <zhaohuabing@gmail.com>2020-08-17 16:27:31 +0300
committerhuabing zhao <zhaohuabing@gmail.com>2020-08-17 16:27:31 +0300
commite37fc5d1eb4ffb184e243f3cafd7d39ad17bb902 (patch)
tree20849f5574e23c5feaa7ffd650e05b059144f5d5
parentc7fa60e7c37ee2003639ec6a4f4924a84d1de50b (diff)
Add title to image
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
-rw-r--r--layouts/_default/_markup/render-image.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
new file mode 100644
index 0000000..13b94cb
--- /dev/null
+++ b/layouts/_default/_markup/render-image.html
@@ -0,0 +1,8 @@
+{{ if .Title }}
+ <figure>
+ <img src="{{ .Destination | safeURL }}" alt="{{ .Text }}">
+ <center><figcaption>{{ .Title }}</figcaption></center>
+ </figure>
+{{ else }}
+ <img src="{{ .Destination | safeURL }}" alt="{{ .Text }}">
+{{ end }}