Skip to content

Commit

Permalink
fix(nuxt/content): support mdx files
Browse files Browse the repository at this point in the history
Fixes #225
  • Loading branch information
harlan-zw committed Feb 1, 2024
1 parent 67b7520 commit fe3acbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/nitro/plugins/nuxt-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export default defineNitroPlugin((nitroApp) => {
const { discoverImages, isNuxtContentDocumentDriven } = useSimpleSitemapRuntimeConfig()
// @ts-expect-error runtime type
nitroApp.hooks.hook('content:file:afterParse', async (content: ParsedContent) => {
if (content.sitemap === false || content._draft || content._extension !== 'md' || content._partial || content.indexable === false || content.index === false)
const validExtensions = ['md', 'mdx']
if (content.sitemap === false || content._draft || !validExtensions.includes(content._extension) || content._partial || content.indexable === false || content.index === false)
return

// add any top level images
Expand Down

0 comments on commit fe3acbc

Please sign in to comment.