commit 64eb2b5476bb1a8223f96ceadc840f0df1e43e0c parent 126a2cdf46be852a4b0efb2e0da46dc562ceb1db Author: David Eisinger <[email protected]> Date: Tue, 10 Nov 2026 00:33:18 -0500 Image captions Diffstat:
| M | themes/v2/assets/css/style.scss | | | 16 | ++++++++++++++++ |
| M | themes/v2/layouts/shortcodes/dither.html | | | 6 | ++++++ |
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/themes/v2/assets/css/style.scss b/themes/v2/assets/css/style.scss @@ -160,6 +160,22 @@ figure { margin: 0; } +.captioned-image { + margin: 1em 0; + + > a { + display: block; + line-height: 0; + } + + figcaption { + margin-top: 0.5em; + font-size: 0.8em; + font-style: italic; + line-height: 1.5; + } +} + img { mix-blend-mode: multiply; width: 100%; diff --git a/themes/v2/layouts/shortcodes/dither.html b/themes/v2/layouts/shortcodes/dither.html @@ -2,7 +2,9 @@ {{ $geo := .Get 1 }} {{ $img := resources.GetRemote (printf "%s/%s?geo=%s" (getenv "DITHER_SERVER") $file $geo) }} {{ $imgClass := .Get 2 }} +{{ $caption := .Get 3 }} +{{ with $caption }}<figure class="captioned-image">{{ end }} <a href="{{ $img.RelPermalink }}"> <img src="{{ $img.RelPermalink }}" @@ -12,3 +14,7 @@ {{ with .Inner }}alt="{{ . }}"{{ end }} > </a> +{{ with $caption }} + <figcaption>{{ . }}</figcaption> +</figure> +{{ end }}