Improve performance by preloading webfonts
This commit is contained in:
parent
322eddf574
commit
9d55ae84a8
3 changed files with 11 additions and 8 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue