Skip to content

Commit c7a2af2

Browse files
committed
mdx plugin
1 parent def3086 commit c7a2af2

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

docusaurus.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,11 @@ module.exports = {
365365
result.frontMatter.image ??= ogImageURL.toString();
366366

367367
const strip = (await import('strip-markdown')).default; // ESM only
368+
const mdx = (await import('remark-mdx')).default; // ESM only
368369

369370
// Use remark to strip markdown and get plain text
370371
const processed = await remark()
371-
.use(mdxRemoveImports).use(strip)
372+
.use(mdx).use(mdxRemoveImports).use(strip)
372373
.process(result.content);
373374
const contentText = String(processed).replace(/\s+/g, ' ').trim();
374375
// Extract the first sentence (ending with . ! or ?) even if it spans multiple lines

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"patch-package": "^8.0.0",
6464
"path-browserify": "^1.0.1",
6565
"remark": "^15.0.1",
66+
"remark-mdx": "^3.1.1",
6667
"remark-mdx-remove-imports": "^1.6.22",
6768
"rimraf": "^6.0.0",
6869
"strip-markdown": "^6.0.0",

0 commit comments

Comments
 (0)