feat: upgrade next-mdx-remote
* chore: upgrade packages Updating packages: - "@mapbox/rehype-prism": "^0.6.0" - "image-size": "1.0.0" - "next-seo": "4.24.0" - "remark-code-titles": "0.1.2" - "remark-footnotes": "^3.0.0" - "eslint-config-prettier": "^8.3.0" - "globby": "11.0.3" - "lint-staged": "^11.0.0" - "remark-stringify": "9.0.1" * feat: upgrade next-mdx-remote It adds MDXRemote and serialize breaking changes Read more at https://github.com/hashicorp/next-mdx-remote/releases/tag/3.0.0 * fix: downgrade remark-math and rehype-katex
This commit is contained in:
committed by
GitHub
parent
6880a4d49f
commit
5e36f320df
@ -1,7 +1,7 @@
|
||||
import MDXComponents from '@/components/MDXComponents'
|
||||
import fs from 'fs'
|
||||
import matter from 'gray-matter'
|
||||
import renderToString from 'next-mdx-remote/render-to-string'
|
||||
import { serialize } from 'next-mdx-remote/serialize'
|
||||
import path from 'path'
|
||||
import readingTime from 'reading-time'
|
||||
import visit from 'unist-util-visit'
|
||||
@ -49,7 +49,7 @@ export async function getFileBySlug(type, slug) {
|
||||
: fs.readFileSync(mdPath, 'utf8')
|
||||
|
||||
const { data, content } = matter(source)
|
||||
const mdxSource = await renderToString(content, {
|
||||
const mdxSource = await serialize(content, {
|
||||
components: MDXComponents,
|
||||
mdxOptions: {
|
||||
remarkPlugins: [
|
||||
|
Reference in New Issue
Block a user