Skip to content

Commit 15e857f

Browse files
committed
Refactor font handling by replacing Google Fonts CDN with self-hosted Inter font
- Added local Inter font to improve build reliability and eliminate intermittent failures. - Updated relevant components to use the new local font import.
1 parent 3364986 commit 15e857f

File tree

8 files changed

+20
-16
lines changed

8 files changed

+20
-16
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
All notable changes to this project will be documented in this file.
44

55
## [unreleased]
6+
### Added
7+
8+
### Changed
9+
- Replaced Google Fonts CDN with self-hosted Inter font to fix intermittent build failures
10+
11+
### Fixed
12+
613

714
## [1.2.2] 2025-03-18
815
### Added

public/fonts/inter/Inter-V.ttf

787 KB
Binary file not shown.

src/app/(common)/layout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useState, useEffect } from "react";
4-
import { Inter } from "next/font/google";
4+
import { inter } from "@/lib/fonts";
55
import "../globals.css";
66
import { cn } from "@/lib/utils";
77
import { SessionProvider } from "@/components/providers/SessionProvider";
@@ -35,8 +35,6 @@ const NotificationProvider = dynamic<{ children: React.ReactNode }>(
3535
}
3636
);
3737

38-
const inter = Inter({ subsets: ["latin"] });
39-
4038
const getTitleFromPathname = (pathname: string) => {
4139
switch (pathname) {
4240
case "/":

src/app/(open)/layout.open.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { Inter } from "next/font/google";
1+
import { inter } from "@/lib/fonts";
22
import "@/app/globals.css";
33
import { ThemeProvider } from "@/components/providers/ThemeProvider";
44

5-
6-
const inter = Inter({ subsets: ["latin"] });
7-
85
export default function OpenSourceHomeLayout({
96
children,
107
}: {

src/app/error.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
"use client";
22

3-
import { Inter } from "next/font/google";
3+
import { inter } from "@/lib/fonts";
44
import "../app/globals.css";
55
import Link from "next/link";
66
import { useEffect, useState } from "react";
77

8-
const inter = Inter({ subsets: ["latin"] });
9-
108
export default function Error({
119
error,
1210
reset,

src/app/loading.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
"use client";
22

3-
import { Inter } from "next/font/google";
3+
import { inter } from "@/lib/fonts";
44
import "../app/globals.css";
55
import { useEffect, useState } from "react";
66

7-
const inter = Inter({ subsets: ["latin"] });
8-
97
export default function Loading() {
108
// Use client-side rendering to avoid hydration issues
119
const [mounted, setMounted] = useState(false);

src/app/not-found.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
"use client";
22

33
import Link from "next/link";
4-
import { Inter } from "next/font/google";
4+
import { inter } from "@/lib/fonts";
55
import "../app/globals.css";
66
import { useEffect, useState } from "react";
77

8-
const inter = Inter({ subsets: ["latin"] });
9-
108
export default function NotFound() {
119
// Use client-side rendering to avoid hydration issues
1210
const [mounted, setMounted] = useState(false);

src/lib/fonts.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import localFont from "next/font/local";
2+
3+
// Load Inter font from local files
4+
export const inter = localFont({
5+
src: "../../public/fonts/inter/Inter-V.ttf",
6+
variable: "--font-inter",
7+
display: "swap",
8+
});

0 commit comments

Comments
 (0)