1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 18:26:38 -04:00

just some refactoring

This commit is contained in:
2022-03-09 14:07:06 -05:00
parent f5c8a7a21a
commit 87848cc697
26 changed files with 533 additions and 558 deletions

View File

@ -1,5 +1,5 @@
import { Html, Head, Main, NextScript } from "next/document";
import { getCssText, preloadUrls } from "../lib/styles/stitches.config";
import { getCssText, fonts } from "../lib/styles/stitches.config";
import * as config from "../lib/config";
// https://nextjs.org/docs/advanced-features/custom-document
@ -7,15 +7,17 @@ const Document = () => {
return (
<Html lang={config.siteLocale?.replace("_", "-")}>
<Head>
{/* static asset preloads */}
<link rel="preload" as="font" type="font/woff2" href={preloadUrls.fonts.InterVar} crossOrigin="anonymous" />
<link
rel="preload"
as="font"
type="font/woff2"
href={preloadUrls.fonts.RobotoMonoVar}
crossOrigin="anonymous"
/>
{/* preload highest priority fonts defined in ../lib/styles/fonts/ */}
{fonts.preloadUrls.map((relativeUrl, index) => (
<link
key={`font-${index}`}
rel="preload"
as="font"
type="font/woff2"
href={relativeUrl}
crossOrigin="anonymous"
/>
))}
{/* stitches SSR: https://stitches.dev/blog/using-nextjs-with-stitches#step-3-ssr */}
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} />