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

feat: TOML front matter support #9516

Open
Commenter25 opened this issue Dec 29, 2023 · 3 comments
Open

feat: TOML front matter support #9516

Commenter25 opened this issue Dec 29, 2023 · 3 comments
Labels

Comments

@Commenter25
Copy link

Summary

Currently, the only format for front matter appears to be YAML. It is possible to load config files in TOML format, but not front matter or even data files. A TOML parser is already part of Jekyll, so it seems best to use it to its full potential.

Motivation

I highly prefer the syntax of TOML, and would choose it over YAML in many cases. I recently got very frustrated with YAML's syntax, in particular the enforcement of spaces for indentation, which mixes poorly with the rest of my files; and despite how well Jekyll, its features, and the Liquid templating language work for me, I considered looking into a different SSG purely to escape YAML. Perhaps my reaction is intense, but I imagine I am not the only one who could find frustration in this.

Jekyll has supported config files in TOML format since 2013, however this has seemingly not been extended to any other aspect of the program. The parser has been there all this time, included with every installation of Jekyll, but it has not been able to be used to its true potential. There are potentially many Jekyll users who would have utilized TOML if it could be used consistently as an alternative to YAML, rather than a niche case for only the config file. I only learned it could be used for configs while thinking of making an issue about this.

Reference-level explanation

Other popular SSGs including Hugo and Zola implemented this with using +++ to surround the front matter instead, clearly distinguishing the usage of YAML and TOML. Besides the obvious benefits of sticking to convention, this would ensure implementing TOML support would have no backwards compatibility implications, and have no conflict with YAML parsing.

Drawbacks

It is another choice which would need to be presented in documentation.

@MatheusRich
Copy link

I'm not against this per se, but what about JSON? Ruby has support for that in the stdlib, so we wouldn't need an external dependency.

@Commenter25
Copy link
Author

Why would another dependency be necessary? As I mentioned, Jekyll already depends on a TOML parser. It just isn't being used as much as it could be.

@MatheusRich
Copy link

Oh, I totally missed that!

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

No branches or pull requests

2 participants