Allow specifying language to use in front matter like so:
---toml
answer = 42
---
Reason
11ty uses gray-matter for parsing front matter, which supports using any language as front matter, but doesn't support +++ notation for TOML.
+++ support workaround for gray-matter
In order to hack in support for `+++`, you have to make `+++` a delimiter, and make TOML the default engine. Here's an example with 11ty config:
```js
const toml = require("@iarna/toml");
module.exports = function(cfg) {
cfg.setFrontMatterParsingOptions({
engines: { toml: toml.parse.bind(toml) },
language: "toml",
delimiters: "+++",
});
};
```
Feature
Allow specifying language to use in front matter like so:
Reason
11ty uses gray-matter for parsing front matter, which supports using any language as front matter, but doesn't support
+++
notation for TOML.
In order to hack in support for `+++`, you have to make `+++` a delimiter, and make TOML the default engine. Here's an example with 11ty config: ```js const toml = require("@iarna/toml"); module.exports = function(cfg) { cfg.setFrontMatterParsingOptions({ engines: { toml: toml.parse.bind(toml) }, language: "toml", delimiters: "+++", }); }; ```+++
support workaround for gray-matter