Skip to content

Commit 978e306

Browse files
committed
Use nextjs link in markdown
1 parent 0949929 commit 978e306

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pages/docs/[doc].tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { SideBar } from "../../components/SideBar";
99
import styled from "styled-components";
1010
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
1111
import { materialOceanic } from "react-syntax-highlighter/dist/cjs/styles/prism";
12+
import Link from "next/link";
1213

1314
const ARTICLES_PATH = path.join(process.cwd(), "articles");
1415

@@ -53,6 +54,13 @@ export default function DocPage(props: Props) {
5354
<ReactMarkdownContainer>
5455
<ReactMarkdown
5556
renderers={{
57+
link: ({ children, href }) => {
58+
return (
59+
<Link href={href}>
60+
<a>{children}</a>
61+
</Link>
62+
);
63+
},
5664
code: ({ language, value }) => {
5765
return <SyntaxHighlighter style={materialOceanic} language={language} children={value} />;
5866
},

0 commit comments

Comments
 (0)