How to add code blocks with syntax highlighting to a Next.js blog with Prism.js | Blog with Next.js

preview_player
Показать описание


Timestamps:
0:00 Introduction
1:15 Serialize your markdown with next-mdx-remote
2:07 Install rehype-prism-plus and rehype-code-titles packages
2:32 Add mxdOptions to your serialize function
3:20 Add a code block to your markdown

You can check out some of the games I have made in the past
Рекомендации по теме
Комментарии
Автор

Hello, does this method work with api on getServerSideRendering? It did not work for me, an error at the end of JSX notDev and unfortunately nothing works.

Razilator
Автор

Try contentlayer instead of next-mdx-remote

jameskulundu
Автор

thank you so much. you're a life saver. i can't thank you enaough

korkmazmerve