From 52a97ab98046d5e85d043092f2015873ee2066ca Mon Sep 17 00:00:00 2001 From: Ansgar Prause <4215065+ansgarprause@users.noreply.github.com> Date: Wed, 15 Nov 2023 23:48:08 +0100 Subject: [PATCH] Self-host web font (#64) --- gatsby-browser.js | 2 ++ gatsby-config.js | 8 ----- package-lock.json | 82 +++++++---------------------------------------- package.json | 2 +- 4 files changed, 14 insertions(+), 80 deletions(-) diff --git a/gatsby-browser.js b/gatsby-browser.js index ae7f5f5..0db61b5 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -4,6 +4,8 @@ import React from "react"; import { LinkProvider } from "./src/components/header/header"; import "modern-normalize/modern-normalize.css"; +import "@fontsource/space-grotesk/400.css"; +import "@fontsource/space-grotesk/700.css"; import "./src/styles/typo.css"; /** @type {import("gatsby").GatsbyBrowser["wrapPageElement"]} */ diff --git a/gatsby-config.js b/gatsby-config.js index bd9eb7d..4d9f8ae 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -26,14 +26,6 @@ module.exports = { }, }, }, - { - resolve: "gatsby-plugin-web-font-loader", - options: { - google: { - families: ["Space Grotesk:400,700"], - }, - }, - }, { resolve: "gatsby-source-filesystem", options: { diff --git a/package-lock.json b/package-lock.json index 43a9e6f..7636025 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "kalk-space", "version": "1.0.0", "dependencies": { + "@fontsource/space-grotesk": "^5.0.15", "@mdx-js/mdx": "^1.6.22", "@mdx-js/react": "^1.6.22", "canvas": "^2.9.1", @@ -18,7 +19,6 @@ "gatsby-plugin-react-leaflet": "^3.0.3", "gatsby-plugin-sass": "^5.6.0", "gatsby-plugin-sharp": "^4.17.0", - "gatsby-plugin-web-font-loader": "^1.0.4", "gatsby-remark-images": "^6.17.0", "gatsby-source-filesystem": "^4.17.0", "gatsby-transformer-sharp": "^4.17.0", @@ -2217,6 +2217,11 @@ "node": ">= 4" } }, + "node_modules/@fontsource/space-grotesk": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/@fontsource/space-grotesk/-/space-grotesk-5.0.15.tgz", + "integrity": "sha512-9LaRK2f2B7X0Mx9F8UTuKuqW4w+Iv0RByoC5WyT7l3VSyepd2aJm+/s14tj8QJY+0gwfUG9P/6Gc8oDWy8+aeA==" + }, "node_modules/@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -13188,27 +13193,6 @@ "node": ">=6.9.0" } }, - "node_modules/babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", - "dependencies": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "node_modules/babel-runtime/node_modules/core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", - "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", - "hasInstallScript": true - }, - "node_modules/babel-runtime/node_modules/regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - }, "node_modules/backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -21148,15 +21132,6 @@ "node": ">=10.13.0" } }, - "node_modules/gatsby-plugin-web-font-loader": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/gatsby-plugin-web-font-loader/-/gatsby-plugin-web-font-loader-1.0.4.tgz", - "integrity": "sha512-3c39bX9CcsYJQFhhmTyjuMJSqpld2rX+HsTOxP9k1PKFR4Rvo3lpzBW4d1tVpmUesR8BNL6u9eHT7/XksS1iog==", - "dependencies": { - "babel-runtime": "^6.26.0", - "webfontloader": "^1.6.28" - } - }, "node_modules/gatsby-react-router-scroll": { "version": "5.20.0", "resolved": "https://registry.npmjs.org/gatsby-react-router-scroll/-/gatsby-react-router-scroll-5.20.0.tgz", @@ -35422,11 +35397,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/webfontloader": { - "version": "1.6.28", - "resolved": "https://registry.npmjs.org/webfontloader/-/webfontloader-1.6.28.tgz", - "integrity": "sha512-Egb0oFEga6f+nSgasH3E0M405Pzn6y3/9tOVanv/DLfa1YBIgcv90L18YyWnvXkRbIM17v5Kv6IT2N6g1x5tvQ==" - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -37622,6 +37592,11 @@ } } }, + "@fontsource/space-grotesk": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/@fontsource/space-grotesk/-/space-grotesk-5.0.15.tgz", + "integrity": "sha512-9LaRK2f2B7X0Mx9F8UTuKuqW4w+Iv0RByoC5WyT7l3VSyepd2aJm+/s14tj8QJY+0gwfUG9P/6Gc8oDWy8+aeA==" + }, "@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -46013,27 +45988,6 @@ } } }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - }, - "dependencies": { - "core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - } - } - }, "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -52419,15 +52373,6 @@ } } }, - "gatsby-plugin-web-font-loader": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/gatsby-plugin-web-font-loader/-/gatsby-plugin-web-font-loader-1.0.4.tgz", - "integrity": "sha512-3c39bX9CcsYJQFhhmTyjuMJSqpld2rX+HsTOxP9k1PKFR4Rvo3lpzBW4d1tVpmUesR8BNL6u9eHT7/XksS1iog==", - "requires": { - "babel-runtime": "^6.26.0", - "webfontloader": "^1.6.28" - } - }, "gatsby-react-router-scroll": { "version": "5.20.0", "resolved": "https://registry.npmjs.org/gatsby-react-router-scroll/-/gatsby-react-router-scroll-5.20.0.tgz", @@ -63166,11 +63111,6 @@ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.4.tgz", "integrity": "sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==" }, - "webfontloader": { - "version": "1.6.28", - "resolved": "https://registry.npmjs.org/webfontloader/-/webfontloader-1.6.28.tgz", - "integrity": "sha512-Egb0oFEga6f+nSgasH3E0M405Pzn6y3/9tOVanv/DLfa1YBIgcv90L18YyWnvXkRbIM17v5Kv6IT2N6g1x5tvQ==" - }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/package.json b/package.json index 8359c70..a5f8713 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "build-storybook": "build-storybook" }, "dependencies": { + "@fontsource/space-grotesk": "^5.0.15", "@mdx-js/mdx": "^1.6.22", "@mdx-js/react": "^1.6.22", "canvas": "^2.9.1", @@ -27,7 +28,6 @@ "gatsby-plugin-react-leaflet": "^3.0.3", "gatsby-plugin-sass": "^5.6.0", "gatsby-plugin-sharp": "^4.17.0", - "gatsby-plugin-web-font-loader": "^1.0.4", "gatsby-remark-images": "^6.17.0", "gatsby-source-filesystem": "^4.17.0", "gatsby-transformer-sharp": "^4.17.0",