Skip to content

Commit 14b42c8

Browse files
committed
hugo: add support for figure titles
Signed-off-by: David Karlsson <[email protected]>
1 parent 90e3e0a commit 14b42c8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

layouts/_default/_markup/render-image.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{ $border := index $params "border" }}
1010

1111

12-
<div
12+
<figure
1313
x-data="{ zoom: false }"
1414
@click="zoom = ! zoom"
1515
class="cursor-pointer hover:opacity-90"
@@ -27,6 +27,9 @@
2727
{{ with .Title }}title="{{ . }}"{{ end }}
2828
class="rounded mx-auto{{ with $border }} border border-divider-light dark:border-divider-dark{{end}}"
2929
/>
30+
{{ with .Title }}
31+
<figcaption class="text-gray-light dark:text-gray-dark">{{ . }}</figcaption>
32+
{{ end }}
3033
<template x-teleport="body">
3134
<div
3235
x-show="zoom"
@@ -48,4 +51,4 @@
4851
/>
4952
</div>
5053
</template>
51-
</div>
54+
</figure>

0 commit comments

Comments
 (0)