Support TOML and JSON frontmatter formats

Hi! I’m very excited to see Lettera. Had a few quick thoughts about what would expand its utility to a wider set of use cases that use Markdown with frontmatter.

It would be really nice if TOML were a supported frontmatter format, as well as (potentially) JSON.

the popular Hugo static site generator supports TOML frontmatter, separated by +++ separators. The +++ convention for TOML is also supported by the Zola SSG, which prefers TOML as its default frontmatter format. I use TOML frontmatter for the contents of static sites, and would like to edit them in Lettera.

The other convention for TOML is to use ---toml, which is supported by the popular gray-matter library. It also supports JSON with ---json. The popular Eleventy site generator uses those convention. Deno’s frontmatter library also supports ---toml and ---json.

  • Lettera Version: Version 1.0.0 (3980)
  • macOS Version: 26.5.1 (25F80)
2 Likes

I heard about JSON frontmatter for the first time in my ancient life this week, so this is surprising :slight_smile: Good to know that tools exist that use TOML (I like TOML personally).

For everyone who’s caught with their pants down with only YAML supported:

If you need TOML/JSON today, your best bet is a script to transform the input file’s YAML to whatever you desire; the formats are mostly interchangeable and only syntactically different.

Mentioning Hugo, they have a converter: Howto: Convert your front matter from TOML to YAML - tips & tricks - HUGO

1 Like