Website Optimization Measures, Part XIII

Published on March 5, 2022 (ā†» August 27, 2023), filed under (RSS feed for allĀ categories).

A fresh installment of the series, today some notes and observations on improving SVG and HTML, styling emphasis and code, and making better use of images. (If youā€™re new to these entries, here is where I casually share improvements to my personal projects.)

  1. Adding titles to SVG files. Quite randomly poking at and optimizing SVGs in my projects, I noticed how many of them had no metadata, no nothing about their contents. That looked like a missed (accessibility) opportunity, and after validating a few tests I decided to make sure each SVG, starting with logos, had a title element that could represent the image. Is it good practice? I believe yes.

  2. Revisiting html-minifier settings. I have a standard config for html-minifier, however as Iā€™m constantly studying HTML (and completed the pilgrimage!), I questioned and reviewed the old setup. You can check the latest in the Eleventy config for Frontend Dogma. (Iā€™m taking note to talk more about special cases, like not removing all quotes, and not always minifying HTML.)

  3. Reviewing use of @autocomplete. Iā€™m collecting string for these posts for months, and in this case I donā€™t know anymore what I did šŸ˜‚ But, Iā€™m sure, it led to better use of the autocomplete attribute.

  4. Adjusting styling for strong elements. As a great exercise in semantics, Iā€™ve run a few projects where I styled em and strong elements the same way. (This way, you canā€™t go by appearance, you have to go by meaning.) But for design reasons, on this website, I changed this, so that both em and strong are still using italics, but strong emphasis also gets a background color. What do you think?

  5. Styling code blocks! I thought about this for many years but couldnā€™t get myself to add the needed code (minimalism). Then, running into highlight.js (and ā€œinheritingā€ Prism from my Eleventy projects), I thought about it again. And I added highlight.js to meiert.com, injected only when a code block is actually present, and leaving it to highlight.js to figure out the type of code. That finally reconciled my preference for minimal code with the added usability of syntax-highlighted code samples.

  6. Adding back favicon markup ā˜ ļø How ironic, no, given how I had written that the ideal favicon markup consists of nothing. But the user agents you yourself are using are powerful, and Firefox on Android has this issue of not using (or discarding) smaller-size favicons. Yet favicons serve a purpose and theyā€™re useful, and therefore I grudgingly andā€”oh please, dear All That Is!ā€”temporarily added link elements to my projects, pointing to each of their favicons.

  7. Switching to large social images. For every personal project, I prepare one large ā€œsocial logo.ā€ For historic reasons, however, I used markupā€”the most minimal social markup I could identify at the timeā€”that didnā€™t take advantage of that. At first suspecting problems with the specific dimensions of these images, it turned out that, for Twitter, all I had to do was to switch from

    <meta name=twitter:card content=summary>

    to

    <meta name=twitter:card content=summary_large_image>

    Done. You can see said ā€œmost minimal social markupā€ in action on any of my projectsā€”like in the Eleventy base template of Frontend Dogma [and in a later article].

This is a part of an open article series. Check out some of the other posts!

Was this useful or interesting? Share (toot) this post, or support my work by buying one of my books (theyā€™re affordable, and many receive updates).Ā Thanks!

About Me

Jens Oliver Meiert, on September 30, 2021.

Iā€™m Jens (long: Jens Oliver Meiert), and Iā€™m a frontend engineering leader and tech author/publisher. Iā€™ve worked as a technical lead for companies like Google and as an engineering manager for companies like Miro, Iā€™m close to W3C and WHATWG, and I write and review books for Oā€™Reilly and FrontendĀ Dogma.

I love trying things, not only in web development (and engineering management), but also in other areas like philosophy. Here on meiert.com I share some of my views andĀ experiences.

If youā€™d like to do me a favor, interpret charitably (I speak three languages, and they do collide), yet be critical and give feedback for me to fix issues, learn, and improve. ThankĀ you!