feat: preload static resources

This commit is contained in:
saberzero1
2026-05-22 23:12:37 +02:00
parent cfcd9c18ac
commit 2a02240802

View File

@@ -36,10 +36,19 @@ export default (() => {
)
const ogImageDefaultPath = `https://${cfg.baseUrl}/static/og-image.png`
const coreStylesheet = css[0]?.content
const coreScript = js.find(
(r) => r.loadTime === "beforeDOMReady" && r.contentType === "external",
)
return (
<head>
<title>{title}</title>
<meta charSet="utf-8" />
{coreStylesheet && <link rel="preload" href={coreStylesheet} as="style" />}
{coreScript && coreScript.contentType === "external" && (
<link rel="preload" href={coreScript.src} as="script" />
)}
{cfg.theme.cdnCaching && cfg.theme.fontOrigin === "googleFonts" && (
<>
<link rel="preconnect" href="https://fonts.googleapis.com" />