Skip to content

Commit

Permalink
feat: optimize font loading, closes #29
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoberger committed Dec 19, 2020
1 parent 9650bc6 commit 08186a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = withPrefresh({
pageExtensions: ["ts", "tsx", "md", "mdx"],
experimental: {
jsconfigPaths: true, // enables it for both jsconfig.json and tsconfig.json
optimizeFonts: true,
},
images: {
domains: ["images.unsplash.com"],
Expand Down
2 changes: 0 additions & 2 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from "react";
import type { AppProps } from "next/app";

import "../css/index.css";
import "typeface-catamaran";
import "typeface-source-serif-pro";
import { Footer } from "components";

// fix for Fontawesomes huge icons on page load
Expand Down
4 changes: 4 additions & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class MyDocument extends Document {
data-domain="ivoberger.com"
src="https://plausible.io/js/plausible.js"
/>
<link
href="https://fonts.googleapis.com/css2?family=Catamaran:wght@400;700&family=Source+Serif+Pro:ital@0;1&display=swap"
rel="stylesheet"
></link>
</Head>
<body>
<Main />
Expand Down

0 comments on commit 08186a3

Please sign in to comment.