diff --git a/packages/integrations/markdoc/src/index.ts b/packages/integrations/markdoc/src/index.ts index 10016750311e5..9d6150e5ba366 100644 --- a/packages/integrations/markdoc/src/index.ts +++ b/packages/integrations/markdoc/src/index.ts @@ -114,7 +114,6 @@ export default function markdocIntegration(legacyConfig?: any): AstroIntegration } from 'astro/runtime/server/index.js'; import { Renderer } from '@astrojs/markdoc/components'; import { collectHeadings, setupConfig, setupConfigSync, Markdoc } from '@astrojs/markdoc/runtime'; -import * as entry from ${JSON.stringify(viteId + '?astroContentCollectionEntry')}; ${ markdocConfigResult ? `import _userConfig from ${JSON.stringify( @@ -137,7 +136,7 @@ export function getHeadings() { '' } const headingConfig = userConfig.nodes?.heading; - const config = setupConfigSync(headingConfig ? { nodes: { heading: headingConfig } } : {}, entry); + const config = setupConfigSync(headingConfig ? { nodes: { heading: headingConfig } } : {}); const ast = Markdoc.Ast.fromJSON(stringifiedAst); const content = Markdoc.transform(ast, config); return collectHeadings(Array.isArray(content) ? content : content.children); diff --git a/packages/integrations/markdoc/src/runtime.ts b/packages/integrations/markdoc/src/runtime.ts index a1861c68ca676..bbbd8573982ae 100644 --- a/packages/integrations/markdoc/src/runtime.ts +++ b/packages/integrations/markdoc/src/runtime.ts @@ -32,13 +32,9 @@ export async function setupConfig( /** Used for synchronous `getHeadings()` function */ export function setupConfigSync( - userConfig: AstroMarkdocConfig, - entry: ContentEntryModule + userConfig: AstroMarkdocConfig ): Omit { - let defaultConfig: AstroMarkdocConfig = { - ...setupHeadingConfig(), - variables: { entry }, - }; + const defaultConfig: AstroMarkdocConfig = setupHeadingConfig(); return mergeConfig(defaultConfig, userConfig); }