1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 08:58:30 -04:00

preload common fonts (in a horrifically hard-coded fashion)

This commit is contained in:
Jake Jarvis 2022-02-09 12:19:29 -05:00
parent cf98cf632c
commit 748f1c4b4c
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39

View File

@ -1,5 +1,6 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import Head from "next/head";
import { ThemeProvider } from "next-themes"; import { ThemeProvider } from "next-themes";
import { DefaultSeo, SocialProfileJsonLd } from "next-seo"; import { DefaultSeo, SocialProfileJsonLd } from "next-seo";
import * as Fathom from "fathom-client"; import * as Fathom from "fathom-client";
@ -69,6 +70,25 @@ const App = ({ Component, pageProps }: Props) => {
<> <>
<ThemeProvider>{getLayout(<Component {...pageProps} />)}</ThemeProvider> <ThemeProvider>{getLayout(<Component {...pageProps} />)}</ThemeProvider>
{/* static asset preloads */}
<Head>
{/* TODO: these hrefs will change at some point (and possibly unpredictably). find a better way... */}
<link
rel="preload"
as="font"
type="font/woff2"
href="/_next/static/media/inter-latin-variable-full-normal.79d31200.woff2"
crossOrigin="anonymous"
/>
<link
rel="preload"
as="font"
type="font/woff2"
href="/_next/static/media/roboto-mono-latin-variable-wghtOnly-normal.3689861c.woff2"
crossOrigin="anonymous"
/>
</Head>
{/* all SEO config is in ./lib/seo.ts except for canonical URLs, which require access to next router */} {/* all SEO config is in ./lib/seo.ts except for canonical URLs, which require access to next router */}
<DefaultSeo <DefaultSeo
{...defaultSeo} {...defaultSeo}