Skip to content

Commit

Permalink
perf: preload font subset
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst committed May 24, 2024
1 parent 2afecbe commit 8bb00ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/layouts/document-layout.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
import "tailwindcss/tailwind.css";
import "@fontsource-variable/inter/slnt.css";
import "@/styles/index.css";
import { isNonEmptyString } from "@acdh-oeaw/lib";
import inter from "@fontsource-variable/inter/files/inter-latin-slnt-normal.woff2?url";
import { ViewTransitions } from "astro:transitions";
import type { WebSite, WithContext } from "schema-dts";
Expand Down Expand Up @@ -82,6 +87,8 @@ const googleSiteVerification = env.PUBLIC_GOOGLE_SITE_VERIFICATION;
<link rel="icon" href="/icon.svg" type="image/svg+xml" sizes="any" />
<link rel="apple-touch-icon" href="/apple-icon.png" type="image/png" sizes="180x180" />

<link rel="preload" as="font" type="font/woff2" href={inter} crossorigin />

<ViewTransitions />

<script
Expand Down
4 changes: 0 additions & 4 deletions src/layouts/page-layout.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
---
import "tailwindcss/tailwind.css";
import "@fontsource-variable/inter/slnt.css";
import "@/styles/index.css";
import SkipLink from "@/components/skip-link.astro";
import WebsiteFooter from "@/components/website-footer.astro";
import WebsiteHeader from "@/components/website-header.astro";
Expand Down

0 comments on commit 8bb00ba

Please sign in to comment.