-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(article): html lang and prefetch
- Loading branch information
1 parent
c582450
commit 9688435
Showing
7 changed files
with
32 additions
and
21 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
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
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
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
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
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,16 +1,22 @@ | ||
import { components } from "@/components/markdown-render"; | ||
import clsx from "clsx"; | ||
import { compileMDX } from "next-mdx-remote/rsc"; | ||
import type { ComponentProps } from "react"; | ||
|
||
const RenderMDTextServer = async ({ | ||
text, | ||
className, | ||
}: { text: string; className?: string }) => { | ||
...props | ||
}: { text: string } & ComponentProps<"div">) => { | ||
const { content } = await compileMDX({ | ||
source: text, | ||
components: { ...components }, | ||
}); | ||
return <div className={clsx("markdown-body", className)}>{content}</div>; | ||
return ( | ||
<div className={clsx("markdown-body", className)} {...props}> | ||
{content} | ||
</div> | ||
); | ||
}; | ||
|
||
export { RenderMDTextServer }; |
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