feat: basic support for mdx file extension (#964)

This commit is contained in:
Daniel Lautzenheiser
2023-10-31 11:31:04 -04:00
committed by GitHub
parent 597d135ff7
commit 215cb21e89
7 changed files with 76 additions and 1 deletions

View File

@ -17,3 +17,6 @@ quote_type = single
[*.md]
trim_trailing_whitespace = false
[*.mdx]
trim_trailing_whitespace = false

View File

@ -0,0 +1,26 @@
---
main_menu:
- label: News
href: /news
- label: Features
href: '#features'
- label: About
href: '#about'
- label: Contact
href: '#contact'
footer_menus:
- label: Company
links:
- label: Home
href: /
- label: 'Privacy Policy '
href: '#'
- label: About us
href: '#'
- label: Documentation
links:
- label: Docs
href: '#'
- label: Blog
href: '#'
---

View File

@ -176,6 +176,45 @@ collections:
- label: Description
name: description
widget: text
- name: navigation
label: Navigation
file: packages/core/dev-test/backends/proxy/_data/navigation.mdx
extension: mdx
format: yaml-frontmatter
fields:
- name: main_menu
label: Main Menu
widget: list
collapsed: true
fields:
- name: label
label: Label
widget: string
- name: href
label: Href
widget: string
- name: footer_menus
label: Footer Menus
widget: list
collapsed: true
reuired: false
fields:
- name: label
label: Label
widget: string
- name: links
label: Links
widget: list
collapsed: true
fields:
- name: label
label: Label
widget: string
- name: href
label: Href
widget: string
- name: kitchenSink
label: Kitchen Sink
folder: packages/core/dev-test/backends/proxy/_sink

View File

@ -26,6 +26,7 @@ export const extensionFormatters: Record<string, FileFormatter> = {
toml: TomlFormatter,
json: JsonFormatter,
md: FrontmatterInfer,
mdx: FrontmatterInfer,
markdown: FrontmatterInfer,
html: FrontmatterInfer,
};