-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preferve references in the frontmatter data
This means that objects generated from YAML anchors now point to the same reference. The same goes for custom frontmatter parsers. Custom parsers may now also return objects that contain recursive references.
- Loading branch information
1 parent
b8ddc31
commit 9e59f0e
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/*@jsxRuntime automatic*/ | ||
/*@jsxImportSource react*/ | ||
export const frontmatter = (() => { | ||
const $0 = { | ||
title: 'Hello frontmatter' | ||
} | ||
return { | ||
original: $0, | ||
reference: $0 | ||
} | ||
})() | ||
function _createMdxContent(props) { | ||
return <></> | ||
} | ||
export default function MDXContent(props = {}) { | ||
const { wrapper: MDXLayout } = props.components || {} | ||
return MDXLayout ? ( | ||
<MDXLayout {...props}> | ||
<_createMdxContent {...props} /> | ||
</MDXLayout> | ||
) : ( | ||
_createMdxContent(props) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
original: &anchor | ||
title: Hello frontmatter | ||
reference: *anchor | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters