Technology News

HTML Boilerplates

Manuel Matuzović goes line-by-line through a boilerplate HTML document. I like it. It’s a good reference and has a lot of the same type of stuff I tend to put in the main HTML template. It makes me think about how opinionated this kind of thing can be. Dang near every line! Not the DOCTYPE, not the <title>, but nearly everything else.

The HTML
<!DOCTYPE html>
<html lang="en" class="no-js">
<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width"> <title>Unique page title - My Site</title> <script type="module"> document.documentElement.classList.remove('no-js'); document.documentElement.classList.add('js'); </script> <link rel="stylesheet" href="/assets/css/styles.css"> <link rel="stylesheet" href="/assets/css/print.css" media="print"> <meta name="description" content="Page description"> <meta property="og:title" content="Unique page title - My Site"> <meta property="og:description" content="Page description"> <meta property="og:image" content="https://www.mywebsite.com/image.jpg"> <meta property="og:image:alt" content="Image description"> <meta property="og:locale" content="en_GB"> <meta property="og:type" content="website"> <meta name="twitter:card" content="summary_large_image"> <meta property="og:url" content="https://www.mywebsite.com/page"> <link rel="canonical" href="https://www.mywebsite.com/page"> <link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="manifest" href="/my.webmanifest"> <meta name="theme-color" content="#FF00FF">
</head> <body> <!-- Content --> <script src="/assets/js/xy-polyfill.js" nomodule></script> <script src="/assets/js/script.js" type="module"></script>
</body>
</html>

Maybe my site doesn’t use any JavaScript or have no-JavaScript fallbacks so I don’t need any of the class name dancing. Maybe my site doesn’t need print styles, but I do need link prefetching. Maybe I don’t care about social images, but I do want critical CSS in the head. It’s a boilerplate, not a prescription — it’s meant to be changed.

There was a time when HTML5 Boilerplate was a huge project in this space. It has a whole GitHub Org! The boilerplate has 50,000 stars! Personally, I feel like the project lost its way when it started to have a src and dist folder and a 200-line Gulp build process, ya know? It worked best as a reference for what stuff any given web project might need, but now I feel like it is intimidating in a way it doesn’t need to be. The boilerplate index file is also quite opinionated. It assumes Normalize and Modernizr, which are certainly not deprecated projects, but also not things I see developers reaching for much anymore. It even assumes Google Analytics usage!

I have no problem with people having and sharing boilerplate documents, but considering how unavoidable being opinionated it is with them, I also like the reference guide approach. Just show me every possible thing that can go in the <head> (a lot of the value of these boilerplates), and I’ll pick and choose what I need (or may have forgotten). To that end, Josh Buchea’s HEAD project is pretty cool.

How angry Apple employees’ petition led to a controversial new hire’s departure
Creating Stylesheet Feature Flags With Sass !default

Related Articles

Links on Performance V

Links on Performance V
Image Optimizer is super fast in comparison to ImageOptim. However, Image Optimizer uses pngquant which I’ve found very aggressive if image quality is a concern. ImageOptim also has additional options,…

The Most INSANE Tech I Saw At CES 2025!

The Most INSANE Tech I Saw At CES 2025!
Here’s some of the best tech I saw at CES 2025 in Las Vegas! EcoFlow – your FIRST Power Solutions. Smarter With AI. Learn more at EcoFlow’s website: https://bit.ly/4fHRorH Use…

How to Design During 3D Printing

how-to-design-during-3d-printing
You must gather all the needed software requirements before you start to 3D print to have a good guide during the process. Examples of some essential “ingredients” to guide you…

Impact of 5G on Artificial intelligence

impact-of-5g-on-artificial-intelligence
Now more and more people are learning about artificial intelligence.  5G has conquered the whole world.  However, what is the connection between them?  In this article we will figure it…

APIs are the Key to Collaborating with Other Systems

apis-are-the-key-to-collaborating-with-other-systems
Today, organizations have changed their modes of operations and streamlined them with new innovative solutions that make business operations more effective. This has been fueled by the growth in technology…