Skip to content

Commit

Permalink
refactor: 2 jsToTreeNode calls -> 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Dec 13, 2022
1 parent f894e2a commit 318fad9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/integrations/mdx/src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ export function rehypeApplyFrontmatterExport(pageFrontmatter: Record<string, any
const { frontmatter: injectedFrontmatter } = safelyGetAstroData(vfile.data);
const frontmatter = { ...injectedFrontmatter, ...pageFrontmatter };
const exportNodes = [
jsToTreeNode(`export const frontmatter = ${JSON.stringify(frontmatter)};`),
jsToTreeNode(
`export const _internal = { injectedFrontmatter: ${JSON.stringify(injectedFrontmatter)} };`
`export const frontmatter = ${JSON.stringify(
frontmatter
)};\nexport const _internal = { injectedFrontmatter: ${JSON.stringify(
injectedFrontmatter
)} };`
),
];
if (frontmatter.layout) {
Expand Down

0 comments on commit 318fad9

Please sign in to comment.