diff options
| author | Ada Isopods <me@bathynomus.xyz> | 2026-11-09 20:49:51 -0600 |
|---|---|---|
| committer | Ada Isopods <me@bathynomus.xyz> | 2026-11-09 20:49:51 -0600 |
| commit | 4450724be12b4dd4937c6536453a3436b6dff3d8 (patch) | |
| tree | 0b8180caab2148c3d4b904624cddf562044a87be /boilerplate.php | |
| parent | bbc6124c6fdd9a23140c288cc6fee991051631e2 (diff) | |
optimizations
Diffstat (limited to 'boilerplate.php')
| -rw-r--r-- | boilerplate.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/boilerplate.php b/boilerplate.php index dc3c2df..7d0723c 100644 --- a/boilerplate.php +++ b/boilerplate.php @@ -1,8 +1,15 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> -<link href="/style.css" rel="stylesheet" type="text/css" media="all"> +<!--link href="/style.css" rel="stylesheet" type="text/css" media="all"--> <?php +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); $favicon_filename = "/favicon.ico"; |
