Add caption to described images without a preview

This commit is contained in:
Hypolite Petovan 2023-10-08 10:28:17 -04:00
parent 2c297da755
commit 2eab25e7c1
2 changed files with 9 additions and 1 deletions

View file

@ -1,5 +1,10 @@
{{if $image->preview}} {{if $image->preview}}
<a data-fancybox="{{$image->uriId}}" href="{{$image->url}}"><img src="{{$image->preview}}" alt="{{$image->description}}" title="{{$image->description}}" loading="lazy"></a> <a data-fancybox="{{$image->uriId}}" href="{{$image->url}}"><img src="{{$image->preview}}" alt="{{$image->description}}" title="{{$image->description}}" loading="lazy"></a>
{{else}} {{else}}
<img src="{{$image->url}}" alt="{{$image->description}}" title="{{$image->description}}" loading="lazy"> <figure>
<img src="{{$image->url}}" alt="{{$image->description}}" title="{{$image->description}}" loading="lazy">
{{if $image->description}}
<figcaption>{{$image->description}}</figcaption>
{{/if}}
</figure>
{{/if}} {{/if}}

View file

@ -12,6 +12,9 @@
</a> </a>
{{else}} {{else}}
<img src="{{$image->url}}" alt="{{$image->description}}" title="{{$image->description}}" loading="lazy"> <img src="{{$image->url}}" alt="{{$image->description}}" title="{{$image->description}}" loading="lazy">
{{if $image->description}}
<figcaption>{{$image->description}}</figcaption>
{{/if}}
{{/if}} {{/if}}
</figure> </figure>