Improve performance by preloading webfonts

This commit is contained in:
jaseg 2025-07-26 13:45:58 +02:00
parent 322eddf574
commit 9d55ae84a8
3 changed files with 11 additions and 8 deletions

View file

@ -1,6 +1,10 @@
---
title: "Thor's Hammer"
date: 2018-05-03T11:59:37+02:00
summary: >
In case you were having an inferiority complex because your friends' IBM Model M keyboards are so much louder than
the shitty rubber dome freebie you got with your pc... Here's the solution: Thor's Hammer, a simple typing cadence
enhancer for PS/2 keyboards.
---
In case you were having an inferiority complex because your friends' IBM Model M keyboards are so much louder than the

View file

@ -5,6 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="color-scheme" content="dark light">
{{- $stylesheet := resources.Get "css/style.css" | resources.ExecuteAsTemplate "style.css" . }}
<link rel="stylesheet" href="{{ $stylesheet.RelPermalink }}">
<link rel="preload" href="{{ (resources.Get "fonts/roboto_slab/RobotoSlab-VariableFont_wght.ttf").RelPermalink }}" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="{{ (resources.Get "fonts/nyght-serif-main/fonts/WEB/NyghtSerif-Regular.woff2").RelPermalink }}" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="{{ (resources.Get "fonts/nyght-serif-main/fonts/WEB/NyghtSerif-Bold.woff2").RelPermalink }}" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="{{ (resources.Get "fonts/nyght-serif-main/fonts/WEB/NyghtSerif-BoldItalic.woff2").RelPermalink }}" as="font" type="font/woff2" crossorigin />
</head>

View file

@ -5,15 +5,8 @@
{{- partial "header.html" . -}}
{{- block "main" . }}{{- end }}
{{- partial "footer.html" . -}}
<script src="/pagefind/pagefind-ui.js"></script>
<script src="/pagefind/pagefind-ui.js" defer></script>
<script>
if(navigator.getEnvironmentIntegrity!==undefined)document.querySelector('body').innerHTML=`<h1>Your browser
contains Google DRM</h1>"Web Environment Integrity" is a Google euphemism for a DRM that is designed to
prevent ad-blocking, and which Google has forced into their browsers against widespread public opposition.
In support of an open web, this website does not function with this DRM. Please install a browser such
as <a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a> that respects your freedom and supports
ad blockers.`;
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({element: "#search", showSubResults: true});
});