~mdkcore/qtrnn-hugo-theme

6a27d90df896ca10596852822b7aaaf2399c0289 — Rodrigo Oliveira 3 years ago 2c0ed52
Use the title attribute from markdown to render the image caption

Based on: https://sebastiandedeyne.com/captioned-images-with-markdown-render-hooks-in-hugo/
1 files changed, 6 insertions(+), 0 deletions(-)

A layouts/_default/_markup/render-image.html
A layouts/_default/_markup/render-image.html => layouts/_default/_markup/render-image.html +6 -0
@@ 0,0 1,6 @@
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}">
{{ if .Title }}
    <figcaption>{{ .Title }}</figcaption>
{{ end }}
</figure>