forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Font optimization bug fix (vercel#24162)
## Bug - [x] Related issues linked using `fixes vercel#23896` - [x] Integration tests added Fixes vercel#23896
- Loading branch information
1 parent
fc53879
commit fff183c
Showing
4 changed files
with
101 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Head from 'next/head' | ||
import Link from 'next/link' | ||
|
||
const WithFont = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700;900&display=swap" | ||
rel="stylesheet" | ||
/> | ||
</Head> | ||
|
||
<div> | ||
Page with custom fonts | ||
<br /> | ||
<br /> | ||
<Link href="/without-font">Without font</Link> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export const getServerSideProps = async () => { | ||
return { | ||
props: {}, | ||
} | ||
} | ||
|
||
export default WithFont |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Head from 'next/head' | ||
import Link from 'next/link' | ||
|
||
const WithoutFont = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<meta name="robots" content="noindex, nofollow" /> | ||
</Head> | ||
<div> | ||
Page without custom fonts | ||
<br /> | ||
<br /> | ||
<Link href="/with-font">With font</Link> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export const getServerSideProps = async () => { | ||
return { | ||
props: {}, | ||
} | ||
} | ||
|
||
export default WithoutFont |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters