hugo: add support for figure titles

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-04-25 15:00:40 +02:00
parent 90e3e0a314
commit 14b42c807b
1 changed files with 5 additions and 2 deletions

View File

@ -9,7 +9,7 @@
{{ $border := index $params "border" }}
<div
<figure
x-data="{ zoom: false }"
@click="zoom = ! zoom"
class="cursor-pointer hover:opacity-90"
@ -27,6 +27,9 @@
{{ with .Title }}title="{{ . }}"{{ end }}
class="rounded mx-auto{{ with $border }} border border-divider-light dark:border-divider-dark{{end}}"
/>
{{ with .Title }}
<figcaption class="text-gray-light dark:text-gray-dark">{{ . }}</figcaption>
{{ end }}
<template x-teleport="body">
<div
x-show="zoom"
@ -48,4 +51,4 @@
/>
</div>
</template>
</div>
</figure>