Skip to content

Commit d1fc0dd

Browse files
committed
open external links in new tab
1 parent ca7d647 commit d1fc0dd

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
"use client"
22

3-
export { default } from "./resources.mdx"
3+
import Resources from "./resources.mdx"
4+
5+
export default function ResourcesPage() {
6+
return (
7+
<Resources
8+
components={{
9+
// @ts-expect-error - not sure how to type this
10+
a: props => {
11+
const isExternal = props.href.startsWith("http")
12+
if (isExternal) {
13+
return <a {...props} target="_blank" rel="noopener noreferrer" />
14+
}
15+
16+
return <a {...props} />
17+
},
18+
}}
19+
/>
20+
)
21+
}

0 commit comments

Comments
 (0)