zola markdown uses “+++” as the marker for front matter on each page. fair enough.
vscode’s built-in markdown previewer doesn’t seem to know what do do with this front matter… it gets glommed onto the front of the preview in a way that is not readable.
the existing markdown extensions for vscode all seem to recognize “—” as a front matter mark. i’m guessing this was lifted from YAML syntax. none of the extensions seem to support a different marking string.
has anyone found a vscode markdown previewer that either strips zola’s “+++” front matter, or previews it in a useful way?
The +++ indicate front matter in the TOML format, while --- are used for YAML front matter. Both formats are supported by Zola:
Note that even though the use of TOML is encouraged, YAML front matter is also supported to ease porting legacy content. In this case the embedded metadata must be enclosed by triple minuses (---).
E.g. Hugo uses the same syntax (while also supporting JSON front matter as a third format).
Until your IDE (plugins) support TOML front matter, you could simply revert to YAML for the time being (conversion between formats can be automated using using e.g. hugo convert).
I just converted all my Zola site to YAML.
As YAML is more supported, is much more pleasant to read and edit by hand for me with my Unix culture, there was no reason to keep using TOML. And thanks to Zola for supporting both.
As said, you can use hugo convert, but I made a small bash script for the fun of it at: