Adding hyperlink to figcaption shortcode?

Hello, I need help

Is there any method to add hyperlink to figcaption?
(situation is 'I want to reference the img’s source)

I tried both markdown syntax

![lorem ipsum](https://example.com)

and HTML

<a href="https://example.com">lorem ipsum</a>

They do not work…

[{{< figure src="images/linux.png" title="Linux" >}}](http://linux.org)

1 Like

Thanks, it works.

But it not perfectly suits my need. My situation is I have an image and its caption. I want to add hyper link in some part of caption, not all caption itself, like…

this is the newest album of Maroon 5 (source)

the bold ‘source’ is where I need to add hyperlink

is there still a method?

You could adapt the default figure shortcode and use something like

{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
2 Likes