denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.95k stars 5.23k forks source link

deno fmt (v1.46+): Ignore front matter in HTML files #25182

Open Brixy opened 2 weeks ago

Brixy commented 2 weeks ago

Thank you very much for adding formatters for HTML, YAML, CSS etc. Fantastic!

If you work with static site generators (my own is based on deno) you can use front matter data (e.g. in YAML, TOML, JSON or JS format) in HTML files. The 11ty documentation provides examples.

Also, template files are often HTML files with a bit of template code (vento, nunjucks or liquid for example). These template files can also contain front matter.

It would be excellent, if deno could just ignore front matter -- generally or by using a flag or language setting.

19458 is kind of related.

Thanks a lot!

g-plane commented 2 weeks ago

Front matter isn't allowed in ".html" files; otherwise, this can be confusing.