Skip to content

Commit

Permalink
Render markdown images with caption
Browse files Browse the repository at this point in the history
  • Loading branch information
chringel21 committed Mar 1, 2022
1 parent 938a109 commit 7dc9894
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ if .Title }}
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}">
<figcaption>{{ .Title }}</figcaption>
</figure>
{{ else }}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}">
{{ end }}

0 comments on commit 7dc9894

Please sign in to comment.