1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 12:35:31 -04:00

support full HTML captions for image shortcode

This commit is contained in:
2019-12-17 11:39:23 -05:00
parent 1b97c6b2de
commit c87bfd7797
22 changed files with 111 additions and 113 deletions

View File

@@ -29,7 +29,8 @@
<p class="image">
<amp-img
{{ with .Get "alt" }}alt="{{ . }}"{{ end }}
{{- with .Get "alt" }} alt="{{ . | safeHTMLAttr }}" title="{{ . | safeHTMLAttr }}"{{ end }}
{{- with .Inner }} alt="{{ . | plainify | safeHTMLAttr }}" title="{{ . | plainify | safeHTMLAttr }}"{{ end }}
src="{{ $image.Permalink }}"
width="{{ $displayWidth }}"
height="{{ $displayHeight }}"
@@ -37,4 +38,4 @@
</amp-img>
</p>
{{- with .Get "caption" }}<p class="caption"><em>{{ . }}</em></p>{{ end -}}
{{- with .Inner }}<p class="caption">{{ . | safeHTML }}</p>{{ end -}}