Skip to content

Commit 352dedf

Browse files
committed
Example: add font optimization example
1 parent 292ab48 commit 352dedf

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"start": "next start"
99
},
1010
"dependencies": {
11+
"@next/font": "13.0.5",
1112
"date-fns": "^2.23.0",
1213
"gray-matter": "^4.0.3",
1314
"next": "13.0.5",
File renamed without changes.

example/pages/font-next-font.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Layout from "../components/layout";
2+
import { MuseoModerno } from "@next/font/google";
3+
4+
const museo = MuseoModerno({
5+
subsets: ["latin"],
6+
weight: "400",
7+
});
8+
9+
export default function Page() {
10+
return (
11+
<Layout>
12+
<article>
13+
<h1>Font — @next/font</h1>
14+
<p><b>Test 1:</b></p>
15+
<p>This uses default font.</p>
16+
<p className={museo.className}>This uses MuseoModerno font.</p>
17+
</article>
18+
</Layout>
19+
);
20+
}

example/pages/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export default function Home({}) {
3939
<Link href={`/image-optimization-imported`}>Image Optimization — imported image</Link><br />
4040
<Link href={`/image-optimization-remote`}>Image Optimization — remote image</Link><br />
4141
<Link href={`/image-html-tag`}>Image using html image tag</Link><br />
42-
<Link href={`/font-css-front`}>Font — CSS Font</Link><br />
42+
<Link href={`/font-css-font`}>Font — CSS Font</Link><br />
43+
<Link href={`/font-next-font`}>Font — @next/font</Link><br />
4344
<Link href={`/page-does-not-exist`}>404 Page not found</Link><br />
4445
</section>
4546
</Layout>

example/pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)