diff --git a/server/plugins/content.ts b/server/plugins/content.ts index 1e597d72ef2920aadacf14d615823401923c2705..0de47c44fee74d361d7c9b3976d673ba3fc78580 100644 --- a/server/plugins/content.ts +++ b/server/plugins/content.ts @@ -5,27 +5,27 @@ import * as d3 from "d3"; export default defineNitroPlugin((nitroApp) => { - nitroApp.hooks.hook('content:file:beforeParse', - (file) => { - if (file?._id?.startsWith('content:3.defense-systems:') && file?._id?.endsWith('.md')) { - const frontMatterRegex = /(?<=---\n).*?(?=\n---)/sg; + // nitroApp.hooks.hook('content:file:beforeParse', + // (file) => { + // if (file?._id?.startsWith('content:3.defense-systems:') && file?._id?.endsWith('.md')) { + // const frontMatterRegex = /(?<=---\n).*?(?=\n---)/sg; - const fontMatterMatch = file.body.match(frontMatterRegex); - if (fontMatterMatch?.length > 0) { - const frontMatter = fontMatterMatch[0] - const parsedFrontMatter = YAML.parse(frontMatter) - if (parsedFrontMatter?.contributors?.length > 0) { - // file.body = file.body.replace(/(^#[\s+]\w*[\s\S])/gm, "$1\n:contributors\n\n") - } - } - } - }) + // const fontMatterMatch = file.body.match(frontMatterRegex); + // if (fontMatterMatch?.length > 0) { + // const frontMatter = fontMatterMatch[0] + // const parsedFrontMatter = YAML.parse(frontMatter) + // if (parsedFrontMatter?.contributors?.length > 0) { + // // file.body = file.body.replace(/(^#[\s+]\w*[\s\S])/gm, "$1\n:contributors\n\n") + // } + // } + // } + // }) nitroApp.hooks.hook( 'content:file:afterParse', (file) => { - if (file?._id?.startsWith('content:3.defense-systems:') && file._id.endsWith('.md')) { + if (file?._id?.startsWith('content') && file._id.endsWith('.md')) { if (file?.body?.children?.length > 0) { // has contributors if (file?.contributors?.length > 0) {