diff --git a/playground/content/real-content/content.md b/playground/content/real-content/content.md index 5b90d6a4b..5bb9e07b9 100644 --- a/playground/content/real-content/content.md +++ b/playground/content/real-content/content.md @@ -89,7 +89,7 @@ Parsers and Transformers can be defined using `defineContentPlugin`: ```ts export default defineContentPlugin({ name: 'plugin-name', - extentions: ['.md'], + extensions: ['.md'], parse: async (id, content) => {}, transform: async content => {} }) diff --git a/src/module.ts b/src/module.ts index 687f6421f..c482b76ab 100644 --- a/src/module.ts +++ b/src/module.ts @@ -279,8 +279,8 @@ export default defineNuxtModule({ // TODO: remove kit usage templateUtils.importSources(contentContext.transformers), `const transformers = [${contentContext.transformers.map(templateUtils.importName).join(', ')}]`, - 'export const getParser = (ext) => transformers.find(p => ext.match(new RegExp(p.extentions.join("|"), "i")) && p.parse)', - 'export const getTransformers = (ext) => transformers.filter(p => ext.match(new RegExp(p.extentions.join("|"), "i")) && p.transform)', + 'export const getParser = (ext) => transformers.find(p => ext.match(new RegExp(p.extensions.join("|"), "i")) && p.parse)', + 'export const getTransformers = (ext) => transformers.filter(p => ext.match(new RegExp(p.extensions.join("|"), "i")) && p.transform)', 'export default () => {}' ].join('\n') }) diff --git a/src/runtime/server/transformers/csv.ts b/src/runtime/server/transformers/csv.ts index 873d0df55..949d887b2 100644 --- a/src/runtime/server/transformers/csv.ts +++ b/src/runtime/server/transformers/csv.ts @@ -2,7 +2,7 @@ import { useRuntimeConfig } from '#imports' export default { name: 'csv', - extentions: ['.csv'], + extensions: ['.csv'], parse: async (_id, content) => { const config = { ...useRuntimeConfig().content?.csv || {} } diff --git a/src/runtime/server/transformers/json.ts b/src/runtime/server/transformers/json.ts index b8ca081b1..fd5139630 100644 --- a/src/runtime/server/transformers/json.ts +++ b/src/runtime/server/transformers/json.ts @@ -2,7 +2,7 @@ import destr from 'destr' export default { name: 'Json', - extentions: ['.json', '.json5'], + extensions: ['.json', '.json5'], parse: async (_id, content) => { let parsed = content diff --git a/src/runtime/server/transformers/markdown.ts b/src/runtime/server/transformers/markdown.ts index a36f3d5a8..48077d6a4 100644 --- a/src/runtime/server/transformers/markdown.ts +++ b/src/runtime/server/transformers/markdown.ts @@ -9,7 +9,7 @@ const importPlugin = async (p: [string, any]) => ([ export default { name: 'markdown', - extentions: ['.md'], + extensions: ['.md'], parse: async (_id, content) => { const config: MarkdownOptions = { ...useRuntimeConfig().content?.markdown || {} } config.rehypePlugins = await Promise.all((config.rehypePlugins || []).map(importPlugin)) diff --git a/src/runtime/server/transformers/path-meta.ts b/src/runtime/server/transformers/path-meta.ts index 53bc2a925..17e91cbe1 100644 --- a/src/runtime/server/transformers/path-meta.ts +++ b/src/runtime/server/transformers/path-meta.ts @@ -22,7 +22,7 @@ const describeId = (_id: string) => { export default { name: 'path-meta', - extentions: ['.*'], + extensions: ['.*'], transform (content) { const { locales, defaultLocale } = useRuntimeConfig().content || {} const { _source, _file, _path, _extension } = describeId(content._id) diff --git a/src/runtime/server/transformers/shiki.ts b/src/runtime/server/transformers/shiki.ts index 4dbd20736..e2c698586 100644 --- a/src/runtime/server/transformers/shiki.ts +++ b/src/runtime/server/transformers/shiki.ts @@ -8,7 +8,7 @@ const withContentBase = (url: string) => { export default { name: 'markdown', - extentions: ['.md'], + extensions: ['.md'], transform: async (content) => { const codeBlocks = [] visit( diff --git a/src/runtime/server/transformers/yaml.ts b/src/runtime/server/transformers/yaml.ts index 94d3189f8..50d5636c4 100644 --- a/src/runtime/server/transformers/yaml.ts +++ b/src/runtime/server/transformers/yaml.ts @@ -2,7 +2,7 @@ import { parseFrontMatter } from '../../markdown-parser' export default { name: 'Yaml', - extentions: ['.yml', '.yaml'], + extensions: ['.yml', '.yaml'], parse: async (_id, content) => { const { data } = await parseFrontMatter(`---\n${content}\n---`) diff --git a/src/runtime/types.d.ts b/src/runtime/types.d.ts index e6a9dc4e5..96da39a69 100644 --- a/src/runtime/types.d.ts +++ b/src/runtime/types.d.ts @@ -105,7 +105,7 @@ export interface Toc { export interface ContentTransformer { name: string - extentions: string[] + extensions: string[] parse?(id: string, content: string): Promise | ParsedContent transform?: ((content: ParsedContent) => Promise) | ((content: ParsedContent) => ParsedContent) }