Using custom shortcodes with md files

Is it possible to use my own shortcode with this syntax…

`![San Francisco from the Treasure Island]( "San Francisco from the Treasure Island")`

rather than this:

`{{< img src="" title="San Francisco from the Treasure Island" >}}`

I would like to override the default Hugo img rendering without having to replace the content in all markdown files. The custom shortcode created a figcaption which Hugo does not seem to support.

Yes, you need to use Markdown Render Hooks:

Also the forum has examples of Image Render Hooks templates like this one:

1 Like

Thank you Alexandros. This was exactly what I was looking for. :grinning: :clap: :clap:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.