Skip to content

Commit 461f6f3

Browse files
authored
Merge pull request tangly1024#1884 from Li-Major/main
字体设置中设置GoogleFonts可能失效,因为现在返回css而非woff,再加一个判断
2 parents 265e6f3 + fb66c58 commit 461f6f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pages/_document.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MyDocument extends Document {
2020
</>}
2121

2222
{BLOG.FONT_URL?.map((fontUrl, index) => {
23-
if (fontUrl.endsWith('.css')) {
23+
if (fontUrl.endsWith('.css') || fontUrl.includes('googleapis.com/css')) {
2424
return <link key={index} rel="stylesheet" href={fontUrl} />
2525
} else {
2626
return <link key={index} rel="preload" href={fontUrl} as="font" type="font/woff2" />

0 commit comments

Comments
 (0)