Using custom shortcodes with md files

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

`![San Francisco from the Treasure Island](https://img.mcdowell.si/2013/06/wpid-20130623_104914_20130623220546093-1.jpg "San Francisco from the Treasure Island")`

rather than this:

`{{< img src="https://img.mcdowell.si/2013/06/wpid-20130623_104914_20130623220546093-1.jpg" 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.