themes-magazine-bold/image_override.templ
Alex Dunmow fe754f634b initial: theme plugin magazine-bold
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/magazine-bold.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:38 +08:00

15 lines
517 B
Plaintext

package main
// mbImageComponent renders an image with optional full-bleed mode and a numbered caption.
// Skips rendering if no src — guarantees zero broken <img>.
templ mbImageComponent(src, alt, caption string, fullBleed bool) {
if src != "" {
<figure class={ "my-8", templ.KV("mb-fullbleed", fullBleed) }>
<img src={ src } alt={ alt } class="w-full h-auto block" loading="lazy"/>
if caption != "" {
<figcaption class="mb-caption font-mono mt-2 px-6">{ caption }</figcaption>
}
</figure>
}
}