Hello from not-content component.
+ diff --git a/playground/basic/content/0.index.md b/playground/basic/content/0.index.md index 579319cb8..a98dfb42b 100644 --- a/playground/basic/content/0.index.md +++ b/playground/basic/content/0.index.md @@ -7,4 +7,6 @@ title: Index - [Playground](/playground) - [Query Builder](/query-playground) - [Custom 404 page](/404) -- [Not Found Content](/not-found-content) \ No newline at end of file +- [Not Found Content](/not-found-content) + +:hello-world diff --git a/playground/basic/nuxt.config.ts b/playground/basic/nuxt.config.ts index 0c7466af3..23d761a2e 100644 --- a/playground/basic/nuxt.config.ts +++ b/playground/basic/nuxt.config.ts @@ -3,6 +3,7 @@ import { resolve } from 'pathe' export default defineNuxtConfig({ extends: ['../shared'], content: { + components: ['hello-world'], sources: { 'translation-fa': { prefix: '/fa', diff --git a/src/module.ts b/src/module.ts index b91e1d5a0..0267bab55 100644 --- a/src/module.ts +++ b/src/module.ts @@ -8,7 +8,8 @@ import { addComponentsDir, addTemplate, extendViteConfig, - installModule + installModule, + addPluginTemplate } from '@nuxt/kit' import { genDynamicImport, genImport, genSafeVariableName } from 'knitwork' import type { ListenOptions } from 'listhen' @@ -20,6 +21,7 @@ import type { Lang as ShikiLang, Theme as ShikiTheme } from 'shiki-es' import { listen } from 'listhen' import { type WatchEvent, createStorage } from 'unstorage' import { joinURL, withLeadingSlash, withTrailingSlash } from 'ufo' +import { pascalCase } from 'scule' import type { Component } from '@nuxt/schema' import { name, version } from '../package.json' import { makeIgnored } from './runtime/utils/config' @@ -58,6 +60,12 @@ export interface ModuleOptions { */ baseURL: string } + /** + * List the components that will be used in markdown. + * + * @default [] + */ + components: string[] /** * Disable content watcher and hot content reload. * Note: Watcher is a development feature and will not includes in the production. @@ -267,6 +275,7 @@ export default defineNuxtModule