Jens Oliver Meiert

Website Optimization Measures, Part XIII

Post from March 5, 2022, filed under .

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 meta data, 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 (I completed the pilgrimage!), I questioned and reviewed the old setup. You can check my latest setup 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.

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

Tweet this? (If it changed your life, you delight me with a coffee.)

About Me

Jens Oliver Meiert, on April 29, 2020.

I’m Jens Oliver Meiert, and I’m an engineering manager and author. I’ve worked as a technical lead for Google, I’m close to the W3C and the WHATWG, and I write and review books for O’Reilly. Other than that, I love trying things, sometimes including philosophy, art, and adventure. Here on meiert.com I share some of my views and experiences.

If you have questions or suggestions about what I write, please leave a comment (if available) or a message.

Read More

Have a look at the most popular posts, possibly including:

Looking for a way to comment? Comments have been disabled, unfortunately.

Cover: The Web Development Glossary.

Perhaps my most comprehensive book: The Web Development Glossary (2020). With explanations and definitions for literally thousands of terms from Web Development and related fields, building on Wikipedia as well as the MDN Web Docs. Available at Apple Books, Kobo, Google Play Books, and Leanpub.

Stay up-to-date? Follow me by feed or on Twitter.

Found a mistake? Email me, jens@meiert.com.

You are here: HomeArchive2022 → Website Optimization Measures, Part XIII

Last update: March 5, 2022

Professional frontend developers produce valid HTML and CSS.