Skip to content

Commit a845c20

Browse files
committed
Add home links to mdx-bundler
1 parent 4fd5437 commit a845c20

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/mdx-bundler/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export async function getStaticProps() {
88
export default function Page({ postNames }) {
99
return (
1010
<div style={{ width: 800, margin: "0 auto", fontFamily: "sans-serif" }}>
11-
<h1>Blog</h1>
11+
<h1>My Blog</h1>
1212
<ul>
1313
{postNames.map((postName) => (
1414
<li key={postName}>

examples/mdx-bundler/pages/posts/[postName].js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { getMDXComponent } from "mdx-bundler/client"
22
import { getPostNames, getPostSource } from "../../src/posts"
3+
import Link from "next/link"
34

45
export function getStaticPaths() {
56
const paths = getPostNames().map((postName) => ({ params: { postName } }))
@@ -17,7 +18,12 @@ export default function Page({ source }) {
1718
const Content = getMDXComponent(source)
1819
return (
1920
<div style={{ width: 800, margin: "0 auto", fontFamily: "sans-serif" }}>
20-
<Content />
21+
<nav>
22+
<Link href="/">👈 Go back home</Link>
23+
</nav>
24+
<main>
25+
<Content />
26+
</main>
2127
</div>
2228
)
2329
}

0 commit comments

Comments
 (0)