Added ability to click on and expand images through figure shortcode

This commit is contained in:
Jeffrey Phillips Freeman 2023-10-21 20:08:04 -04:00
parent a2f6896b7e
commit 2cfca058d5
No known key found for this signature in database
GPG key ID: AD914585C9406B6A
2 changed files with 4 additions and 1 deletions

View file

@ -5,6 +5,7 @@
* When a post has an `image_header` parameter this image is set as an attachment
to ActivityPub posts
* Fixed some poor CSS rendering for quote-box.
* the `figure` shortcode will now make images clickable to see the full size.
## 2.1.0

View file

@ -1,4 +1,5 @@
<figure>
{{- if .Get "src" }}<a href="{{ .Get "src" }}">{{ end }}
<img
{{ with .Get "src" }}src="{{ . }}"{{ end }}
{{ with .Get "alt" }}alt="{{ range (split . " ") }}{{ . }} {{ end }}"{{ end }}
@ -9,5 +10,6 @@
{{ with .Get "width" }}width="{{ . }}"{{ end }}
{{ with .Get "height" }}height="{{ . }}"{{ end }}
{{ with .Get "layout" }}layout="{{ . }}"{{ end }} />
{{- if .Get "src" }}</a>{{ end }}
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}
</figure>
</figure>