themes-scifi-clean/blocks/diagram_caption.ninjatpl
Alex Dunmow dc4cc2d8b3 feat: convert to codeless .bnp — templates + manifest, Go/templ deleted (WO-WZ-021)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 15:24:40 +08:00

10 lines
1.1 KiB
Plaintext

<figure data-block="scifi-clean:diagram_caption" class="my-8 max-w-3xl mx-auto px-4">
<div class="relative hairline bg-card">
{% if image %}<img src="{{ image }}" alt="{{ title }}" class="block w-full h-auto">{% for pin in calloutPins %}<span class="absolute inline-flex items-center scifi-mono text-xs uppercase tracking-wider px-2 py-1 bg-card text-foreground hairline" style="left: {{ pin.x|floatformat:2 }}%; top: {{ pin.y|floatformat:2 }}%;">{{ pin.label }}</span>{% endfor %}{% else %}<div class="bg-grid aspect-video flex items-center justify-center"><span class="scifi-mono text-sm text-muted-foreground uppercase tracking-widest">No diagram yet</span></div>{% endif %}
</div>
<figcaption class="mt-3 hairline-t pt-3">
<h4 class="scifi-h4 scifi-mono text-sm uppercase tracking-widest text-foreground">Fig. {% if figureNumber %}{{ figureNumber }}{% else %}00{% endif %} . {% if title %}<span class="text-muted-foreground ml-2">{{ title }}</span>{% endif %}</h4>
{% if body %}<div class="scifi-body prose prose-sm max-w-none text-muted-foreground mt-2">{{ body|safe }}</div>{% endif %}
</figcaption>
</figure>