Skip to content

Commit

Permalink
chore: remove unused entry stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed May 30, 2023
1 parent 2cbb321 commit d006c27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions packages/integrations/markdoc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
Expand Down
8 changes: 2 additions & 6 deletions packages/integrations/markdoc/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ export async function setupConfig(

/** Used for synchronous `getHeadings()` function */
export function setupConfigSync(
userConfig: AstroMarkdocConfig,
entry: ContentEntryModule
userConfig: AstroMarkdocConfig
): Omit<AstroMarkdocConfig, 'extends'> {
let defaultConfig: AstroMarkdocConfig = {
...setupHeadingConfig(),
variables: { entry },
};
const defaultConfig: AstroMarkdocConfig = setupHeadingConfig();

return mergeConfig(defaultConfig, userConfig);
}
Expand Down

0 comments on commit d006c27

Please sign in to comment.