Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a list of supported document types for source-files #46

Open
seancdavis opened this issue Apr 29, 2022 · 3 comments
Open

Add a list of supported document types for source-files #46

seancdavis opened this issue Apr 29, 2022 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@seancdavis
Copy link
Contributor

seancdavis commented Apr 29, 2022

Double check, but I believe it's:

  • Markdown (with various extensions)
  • MDX
  • JSON
  • YAML

Might be worthwhile to note what it is that tells Contentlayer how to process content. Is it the file extension?

cc @schickling

@seancdavis seancdavis added the documentation Improvements or additions to documentation label Apr 29, 2022
@schickling
Copy link
Contributor

Might be worthwhile to note what it is that tells Contentlayer how to process content. Is it the file extension?

It's not the file extension but the contentType.

@seancdavis
Copy link
Contributor Author

@schickling And if contentType is not set, does it fall back to the file extension, or does it have a static default (e.g. markdown?)

@schickling
Copy link
Contributor

It always defaults to markdown right now. While it might sound intuitive to derive the content type based on the file extension of a given file, it's not what you want in most cases, as you need a "static guarantee" that all documents adhere to the same content type.

What we could consider doing though is derive the content type dynamically as long as all pieces of content have the same file extension. If that's not the case, show an error and ask the user to either specify a contentType or change the file extension. (I kind of like this idea.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants