-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(markdown): add support for TOML frontmatter in Markdown files. (#…
- Loading branch information
Showing
5 changed files
with
141 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
'@astrojs/markdown-remark': minor | ||
--- | ||
|
||
Adds support for TOML frontmatter in `.md` and `.mdx` files | ||
|
||
Astro 5.2 automatically identifies the format of your Markdown and MDX frontmatter based on the delimiter used. With `+++` as a delimiter (instead of the `---` YAML code fence), your frontmatter will automatically be recognized and parsed as [TOML](https://toml.io). | ||
|
||
This is useful for adding existing content files with TOML frontmatter to your project from another framework such as Hugo. | ||
|
||
TOML frontmatter can also be used with [content collections](https://docs.astro.build/guides/content-collections/), and files with different frontmatter languages can live together in the same project. | ||
|
||
No configuration is required to use TOML frontmatter in your content files. Your delimiter will indicate your chosen frontmatter language: | ||
|
||
```md | ||
+++ | ||
date = 2025-01-30 | ||
title = 'Use TOML frontmatter in Astro!' | ||
[author] | ||
name = 'Colin Bate' | ||
+++ | ||
|
||
# Support for TOML frontmatter is here! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.