-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support client-side routing
- Loading branch information
Showing
1 changed file
with
9 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import Head from "next/head"; | ||
import { MDXComponents } from "mdx/types"; | ||
import Link from "next/link"; | ||
|
||
// To have client-side routing | ||
const CustomLink: MDXComponents["a"] = (props) => ( | ||
<Link href={props.href!}> | ||
<a {...props} /> | ||
</Link> | ||
); | ||
|
||
/** | ||
* Use Next's components in MDX (e.g. Head) | ||
*/ | ||
export const mdxComponents: MDXComponents = { | ||
a: CustomLink, | ||
// https://github.com/mdx-js/mdx/discussions/1921 | ||
head: Head as any, | ||
}; |
9a1ce76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
memos-pub – ./
memos.pub
ancaois.me
www.chars.fyi
mquy.dev
notes.huydx.dev
notes.ancaois.me
blog.keva.dev
notes.snacky.blog
*.memos.pub
thien.do
memo.dev-random.io
chars.fyi
memos-pub-thien-do.vercel.app
www.mquy.dev
memos-pub-git-main-thien-do.vercel.app