Files
kestrelsnest-blog/layouts/shortcodes/img.html
Eric Wagoner b727f92496 Add pantry inventory post with styled images
- Add "Where Did I Put the Mochi Flour?" post about pantry organization app
- Add img shortcode for figure/caption support across themes
- Add CSS styling for figures: rounded corners, shadows, centered captions
- Update standup post date to 2026-01-06

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 16:29:55 -05:00

42 lines
1.6 KiB
HTML

<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
{{ with .Get "align" }}<div align="{{.}}">{{ end }}
{{ with .Get "href" }}<a href="{{.}}">{{ end }}
<img src="{{ or (.Get "src") (.Get 0) }}"
{{ with .Get "class" }}class="{{.}}"{{ end }}
{{ if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"
{{ end }}
{{ with .Get "width" }}width="{{.}}"{{ end }}
{{ with .Get "height" }}height="{{.}}"{{ end }}
/>
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>
{{ if isset .Params "title" }}<h4>{{ .Get "title" }}</h4>{{ end }}
{{ if or (.Get "caption") (.Get "attr")}}
{{ .Get "caption" }}
{{ if isset .Params "attrlink"}}
{{ if isset .Params "align"}}
{{/* we need the class here to remove margin-left for center alignment */}}
<a class="{{.Get "align"}}" href="{{.Get "attrlink"}}">
{{ else }}
<a href="{{.Get "attrlink"}}">
{{ end }}
{{ end }}
{{ .Get "attr" }}
{{ if isset .Params "attrlink"}}</a>{{ end }}
{{ end }}
</figcaption>
{{ end }}
{{ if isset .Params "align" }}</div>{{ end }}
{{ if isset .Params "href" }}</a>{{ end }}
</figure>