One boilerplate, many possible documents
Manuel Matuzović's line-by-line walkthrough of an HTML boilerplate document is a useful reference, and it lands close to what tends to appear in a main HTML template. It also makes plain how opinionated a document like this is: nearly every line is a choice. The DOCTYPE and the <title> aren't; almost everything else is.
<!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="https://css-tricks.com/assets/css/styles.css">
<link rel="stylesheet" href="https://css-tricks.com/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="https://css-tricks.com/favicon.ico">
<link rel="icon" href="https://css-tricks.com/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="https://css-tricks.com/apple-touch-icon.png">
<link rel="manifest" href="https://css-tricks.com/my.webmanifest">
<meta name="theme-color" content="#FF00FF">
</head>
<body>
<!-- Content -->
<script src="https://css-tricks.com/assets/js/xy-polyfill.js" nomodule></script>
<script src="https://css-tricks.com/assets/js/script.js" type="module"></script>
</body>
</html>
What a boilerplate assumes about your site
The assumptions pile up quickly once you read a template critically. A site that ships no JavaScript, or has no no-JavaScript fallbacks, doesn't need class name dancing. A site may have no use for print styles but still want link prefetching. Social images may not matter at all, while critical CSS in the head does. The document is a starting point, not a prescription — it exists to be changed.
The HTML5 Boilerplate era
HTML5 Boilerplate once dominated this space, complete with an entire GitHub organization and 50,000 stars on the main repository. In Matuzović's view, the project lost its way once it grew a src and dist folder and a 200-line Gulp build process. Its real value was as a reference for what a web project might need; that structure made it more intimidating than it had to be.
The template's own index file is highly opinionated too. It presumes Normalize and Modernizr — neither deprecated, but neither something developers reach for much anymore — and it even presumes Google Analytics usage.
Reference list versus template
Sharing a boilerplate document is fine. But given how unavoidably opinionated any such document is, the reference guide approach has real appeal: show every possible thing that can go in the <head>, which is where much of the value of these boilerplates sits, and let the reader pick what they need or may have forgotten. Josh Buchea's HEAD project serves that purpose well.



