Enhancement: Support Creation of "new" .mdx content items
See original GitHub issueIs your feature request related to a problem? Please describe. As someone who exclusively uses MDX for content creation (as well as FrontMatter) I’m frustrated when creating new content because I need to change the file extension manually to support my workflow-- despite the plugin generally supporting FrontMatter in MDX files.
Describe the solution you’d like
In ArticleHelper, the createContent
method hard-codedly decides that the file extension should be “.md”. Similarly, this happens in template generation as well.
I’d propose this be determined via a frontmatter setting.
Describe alternatives you’ve considered
- Manually changing the file extension on my own every time I create new content (not preferred)
- Creating a field to the content type template definitions in
frontMatter.taxonomy.contentTypes
per @zivbk1 here. - Respecting the file extension for template files per @zivbk1 here
Additional context I would anticipate a change like this would be fully backwards compatible, as the default extension should remain “.md”.
I’m happy to open a PR to address this once there’s some buy-in.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top GitHub Comments
@zivbk1 I agree that these are also great alternatives. Updated description.
@farmerau I have added better
mdx
support for content creation. Things that changed:md | mdx
. This is a new property (optional) on thefrontMatter.taxonomy.contentTypes
setting calledfileType
.frontMatter.content.defaultFileType
setting for the file type to create. This setting is by default set tomd
, but if you change it tomdx
, all new content will be created asmdx
files. The benefit of this setting is that you only need to specify it once, and all content types will use it.This is now available in the beta version. Feel free to give it a try, and let me know how it works for you. Beta version can be found here: https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta