aboutsummaryrefslogtreecommitdiff
path: root/boilerplate.php
diff options
context:
space:
mode:
authorAda Isopods <me@bathynomus.xyz>2026-11-09 21:12:40 -0600
committerAda Isopods <me@bathynomus.xyz>2026-11-09 21:12:40 -0600
commit87f36948e1f403afdd0e59fe46aa09d0e9c62303 (patch)
treefb2f67de22a734065f4692f12dbadaad5f7ea05b /boilerplate.php
parent33021d0dfd13bccd3ba54cf55d93bc5d0d5d3270 (diff)
layout shift optimizations
Diffstat (limited to 'boilerplate.php')
-rw-r--r--boilerplate.php4
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);