Skip to content

Commit

Permalink
feat: preload local font
Browse files Browse the repository at this point in the history
  • Loading branch information
jandiralceu committed Sep 15, 2024
1 parent d096455 commit 8c75c3d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gatsby-ssr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as React from "react";
import { GatsbySSR } from "gatsby";

export const onRenderBody: GatsbySSR["onRenderBody"] = ({
setHeadComponents,
}) => {
setHeadComponents([
React.createElement("link", {
key: "kally-dreams",
rel: "preload",
href: "/fonts/Kally_dreams.otf",
as: "font",
type: "font/otf",
crossOrigin: "anonymous",
}),
]);
};

0 comments on commit 8c75c3d

Please sign in to comment.