Skip to content

Commit df9b270

Browse files
authored
Merge pull request #10 from QwenLM/sync
fix:Font files are loaded dynamically via JavaScript
2 parents 2971089 + eefbab2 commit df9b270

File tree

14 files changed

+99
-78
lines changed

14 files changed

+99
-78
lines changed

website/app/layout.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Metadata } from "next";
44
import { Head } from "nextra/components";
55
import type { FC, ReactNode } from "react";
66
import "nextra-theme-docs/style.css";
7+
import { FontLoader } from "../src/components/font-loader";
78

89
export const metadata: Metadata = {
910
description: "x",
@@ -32,10 +33,6 @@ type LayoutProps = Readonly<{
3233
}>;
3334

3435
const RootLayout: FC<LayoutProps> = ({ children }) => {
35-
// 根据环境设置字体路径前缀
36-
const isProduction = process.env.NODE_ENV === "production";
37-
const fontPrefix = isProduction ? "/qwen-code-docs" : "";
38-
3936
return (
4037
<html suppressHydrationWarning>
4138
<Head
@@ -48,7 +45,8 @@ const RootLayout: FC<LayoutProps> = ({ children }) => {
4845
saturation: { dark: 74, light: 74 },
4946
}}
5047
/>
51-
<body style={{ "--font-prefix": fontPrefix } as React.CSSProperties}>
48+
<body>
49+
<FontLoader />
5250
{children}
5351
</body>
5452
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)