As much as I like YAML, TOML is where it's at. I'm sure @mojombo would agree. TOML is fully-featured and still very readable.
We'd need a Ruby parser. Based on TOML's README under "Implementations", we have the following four options:
My proposal is to add in support for TOML alongside YAML files, i.e. this is valid:
$ jekyll build --config _config.yml,overrides.toml
TOML and YAML would thus both be supported by Jekyll.
This is a good idea, I like it. So far I've only tried jm's toml, because it supports the same API as YAML, so you just need to change the class name in your code to switch to TOML.
I've done an experiment (quick and dirty, this is a spike branch) last month with supporting both TOML and YAML. I ended up with code like this:
I'm just using the extension, I haven't looked if some mime-type Ruby libraries can detect TOML.
Edit: Of course it's easy enough to write a wrapper to get any toml gem to use the same API as YAML :)
Yeah, I use @jm's as well, though I figured we wouldn't discount the others.
Parse TOML or YAML in Jekyll::Configuration.
Better config file parser error if it's not there.
Give that LoadError a good message.
require the TOML gem, idiot.
Add some unit tests for TOML integration.
@mattr- I think this is ready to go. Lemme know.
Update history to reflect merge of #1765
Seems to fail with Ruby 1.8.7: https://travis-ci.org/mojombo/jekyll/builds/14960126
Urgh. So it does. Now to figure out why and to dig up an old version of 1.8.7 😺
@maul-esel I can't quite narrow down why that happens. Do you have a minute to take a look?
It seems the TOML parser reads the config file totally wrong, though I have no idea why.
It outputs the following:
which of course doesn't match the expected output. Is that some weird encoding error? But then why does it recognize the keys? Maybe @jm can help here?