diff options
author | 2022-08-12 17:17:26 -0500 | |
---|---|---|
committer | 2022-08-12 18:17:26 -0400 | |
commit | f7afdb889fe4e97177958c8ec92f80c5f6e5cb51 (patch) | |
tree | bcc42e78a52a91a9a5efe14e93e3c517acb2b441 /packages/integrations/mdx/src/astro-data-utils.ts | |
parent | 437bf73f264b2811b7ee8f11c2b54d3414144a0f (diff) | |
download | astro-f7afdb889fe4e97177958c8ec92f80c5f6e5cb51.tar.gz astro-f7afdb889fe4e97177958c8ec92f80c5f6e5cb51.tar.zst astro-f7afdb889fe4e97177958c8ec92f80c5f6e5cb51.zip |
[MDX] Fix remaining inconsistencies with Markdown (#4268)
* feat: add "file" and "url" to layout props
* feat: add rawContent and compiledContent errs
* fix: add "file" and "url" to frontmatter
* fix: add separate MDX instance type
* types: add MarkdownLayoutProps and MDXLayoutProps
* refactor: simplify MDXLayoutProps
* test: pass file and url to layout
* test: glob components with .default and Content
* feat: add <Content /> to MDX
* feat: declare MDX type module
* fix: [MD] move file and url to layout props only
* chore: changeset
* chore: bump MDX to "minor" with more details
* refactor: remove "file" + "url" top-level props (save for minor)
* revert: MDInstance type def updates (save for minor)
* fix: MDXInstance "default" + "content" types
* fix: bad test layout
* chore: remove getHeaders fro *.mdx
Diffstat (limited to 'packages/integrations/mdx/src/astro-data-utils.ts')
-rw-r--r-- | packages/integrations/mdx/src/astro-data-utils.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/integrations/mdx/src/astro-data-utils.ts b/packages/integrations/mdx/src/astro-data-utils.ts index 0bc375c27..f3d04e431 100644 --- a/packages/integrations/mdx/src/astro-data-utils.ts +++ b/packages/integrations/mdx/src/astro-data-utils.ts @@ -28,6 +28,8 @@ export function rehypeApplyFrontmatterExport(pageFrontmatter: Record<string, any export default function ({ children }) { const { layout, ...content } = frontmatter; + content.file = file; + content.url = url; content.astro = {}; Object.defineProperty(content.astro, 'headings', { get() { |