### Tek's Domain

#<NTA:NnT:SSrgS:H6.6-198:W200-90.72:CBWg>

# Doing What Markdown Can't: Specifying Image Width and Height

By default, the Markdown renderer in Hugo, at this point in time, is Goldmark, a CommonMark compliant renderer. CommonMark makes no provisions for manually specifying the width or height of an image. There’s various extensions, like those for Pandoc, Kramdown, and GFM, but Goldmark doesn’t support those. Google is getting a little cranky with the amount of CLS on some pages, especially on mobile, so it’s a good idea for me to start specifying sizes for most images. How should I do this? By hacking it on as a feature that is in no way the intended use for anything involved.

# Detailed Images, With No Shortcodes

If you remember when I first added the Medium Zoom library, I wasn’t using one of its features: the ability to load a larger image when the user clicks to zoom in, only when the user wants to zoom in. However, I added this later, and in that, the method I used was to use a Hugo shortcode to include the image with proper attributes in the <img> tag. Well as it turns out, I don’t need to do this. Now, I can have that happen automatically with standard Markdown ![image links]().

# Adding proper TOCs to my posts (AKA theme update)

Fun fact: until recently, I’ve yet to update the Bilberry theme since I started this. Well, I just updated. And hopefully, you’ll see some changes immediately. Anyways, here’s the list of user-facing changes: Tables of Contents What I think is the biggest update here… proper support for a table of contents for a post, automatically generated off the headings. Well, not only is that a thing that can happen now by setting a variable in my posts, but I even have a shortcode for where this gets generated. Continue reading