-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat(markdown): add support for TOML frontmatter in Markdown files. #12850
base: main
Are you sure you want to change the base?
Conversation
Why would we allow TOML frontmatter in |
@ematipico Apologies, I didn't mean to imply this was only for MDX files. It works for both. |
Yes, yes it should! 😄 But cool feature! Please make sure to loop me in early on this for any docs work if the feature is accepted! Off the top of my head:
Note that I don't think we need e.g. a new section on "Using TOML for your frontmatter instead." I would simply update wherever we do reference YAML specifically as "the" frontmatter language. As long as the values in frontmatter are used the same way, whether YAML or TOML, there's no need to really call out one language or another. |
Thanks Sarah, yes the values are there on the And I agree that it doesn't need to be called out in a big way. Having it mentioned when frontmatter comes up is fine. I think as long as it surfaces when someone searches the docs for TOML then it will be a win. |
🦋 Changeset detectedLatest commit: d5c4ef5 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The whole team is onboard with the new feature, however we need to have documentation in place. Once the documentation is there, we can merge it with the other minors |
OK, I'll add the updates to the docs, coordinating with @sarah11918 |
Changes
@astrojs/markdown-remark
to accept TOML format+++
as the delimitersTesting
Updated the
frontmatter.test.js
file, adding TOML equivalent tests alongside the existing YAML tests. Worth noting that the TOML test run notably faster, owing to the faster parsingDocs
This is certainly something that should be documented. It allows you to use TOML based frontmatter, which is particularly useful if migrating from Hugo or another system that preferred TOML and you don't want to convert potentially thousands of files.
Works for content collections, or with standalone markdown files.
/cc @withastro/maintainers-docs for feedback!