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.

Continue reading

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]().

Continue reading

Temperatures as You Like

So here’s a short one for you: Do you like your temperatures expressed as °F, or °C?1

Well, there’s one fundamental issue with me writing like the way I have been. I can put, say, “I decreased temperatures by 20°F by cleaning the fans,” but if you’re a °C person, then you need to take a quick detour to convert that to units that you’re more familiar with. A common way to do this would be to notate that as “20°F (11.11 °C)”, which works, but I’m effectively stating myself twice, and hoping that I actually got my numbers right. Plus that opens up the possibility for writing °F (°C) one time, and °C (°F) another. So for basically no benefit except me getting to be proud of myself, let’s improve on that.

Continue reading

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

Adding Detailed Zoom Images

Remember the time I added Medium Zoom? Well as it turns out, as I was reading through Zoom’s documentation, that you can specify a separate URL to load when the image zooms in. I like this, because I crop all my images to be (for landscape oriented) 1000 pixels wide, just slightly over the size of the content area that they go into. This is a serious reduction in size from the resolution they’re taken at. I do this just to improve load times, even with WebP and compression, extra pixels (that get resized to nothingness) are extra data that needs to be sent. And since it’s literally too big to be shown like that, I crop them so that pages load nearly instantly. The problem is that when you click on an image to see it, you get… basically nothing. I (because reasons) don’t have any old images so they’ll stay the same. But from now on, any images that are added in will have a detailed version that loads when you click to zoom.

Continue reading

Teknikaldomain.me Website Architecture Overview

So I just checked in with initialcommit.com, the website run by Jacob Stopak, the same person I collaborated with to help explain the internals of version control systems, not once, but twice even. And he published an overview of how he made the site, and what tools he used. As I was looking, I noticed, we took a very different approach to get to two similar endpoints.

If you just want to see what I did, read on. If you want to see the differences, or are just curious about the various ways that sites can be built, read his first, then come back with that knowledge in mind.

Continue reading
Older posts