All I wanted to do this morning was to add a class to an image in Hugo. At first I thought I needed to override my themeās image-render hook, but then I learned that could use the built-in Markdown attributes. It required a new setting or two1, but worked great for adding a style to images in a single post. In lists, however, the styles are applied to the paragraph above the image, even with wrapStandAloneImageWithinParagraph set to false. I couldnāt figure it out, so I just put the paragraph after the images. Not a solution, but solved the problem in this case. This will happen again, Iām sure. Normally, Iād just use raw HTML for this, but the image pipeline in Hugo ābundlesā wouldnāt work, and I need that.
...