diff options
| author | Ada Isopods <me@bathynomus.xyz> | 2026-11-09 21:12:40 -0600 |
|---|---|---|
| committer | Ada Isopods <me@bathynomus.xyz> | 2026-11-09 21:12:40 -0600 |
| commit | 87f36948e1f403afdd0e59fe46aa09d0e9c62303 (patch) | |
| tree | fb2f67de22a734065f4692f12dbadaad5f7ea05b /boilerplate.php | |
| parent | 33021d0dfd13bccd3ba54cf55d93bc5d0d5d3270 (diff) | |
layout shift optimizations
Diffstat (limited to 'boilerplate.php')
| -rw-r--r-- | boilerplate.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/boilerplate.php b/boilerplate.php index 7d0723c..58f322a 100644 --- a/boilerplate.php +++ b/boilerplate.php @@ -3,12 +3,14 @@ <!--link href="/style.css" rel="stylesheet" type="text/css" media="all"--> <?php + +echo("<!-- Ridiculously, inlining your main stylesheet makes Lighthouse's performance scorer happy, so it's done server-side here. --><style>".file_get_contents($_SERVER['DOCUMENT_ROOT']."/style.css")."</style>"); + function fontcode($fontfile) { echo("<!-- apparently, this is the best way to load fonts for optimal performance --><link rel='preload' as='style' href='$fontfile' /><link rel='stylesheet' href='$fontfile' media='print' onload=\"this.media='all'\" /><noscript><link rel='stylesheet' href='$fontfile' /></noscript>"); } fontcode("/fonts/b612mono.css"); -echo("<!-- Ridiculously, inlining your main stylesheet makes Lighthouse's performance scorer happy, so it's done server-side here. --><style>".file_get_contents($_SERVER['DOCUMENT_ROOT']."/style.css")."</style>"); $fun = rand(0,8192); |
