4 ms·
I don't think the author is wrong for wanting to use something different or write their own tool, but the YAML front matter format is much bigger than just Hugo
by mikey_p 6y ago
I don't think the author is wrong for wanting to use something different or write their own tool, but the YAML front matter format is much bigger than just Hugo. There are tons of libraries out there, and even Github has a special viewer for Markdown files with front matter.
e.g.
Ruby: https://rubygems.org/gems/front-matter https://rubygems.org/gems/front-matter
Python: https://pypi.org/project/python-frontmatter/ https://pypi.org/project/python-frontmatter/
Javascript: https://www.npmjs.com/package/front-matter https://www.npmjs.com/package/front-matter
PHP: https://packagist.org/packages/webuni/front-matter https://packagist.org/packages/webuni/front-matter
Go: https://github.com/gernest/front https://github.com/gernest/front
Elixir: https://github.com/sebastiandedeyne/yaml_front_matter https://github.com/sebastiandedeyne/yaml_front_matter
Clojure: https://github.com/liquidz/frontmatter https://github.com/liquidz/frontmatter
And many of those languages have more than one library.
Like it or not front matter in Markdown files is a bit of a standard these days.
- kayodelycaon 6y agoAnd it's not difficult to deal with it manually. Grab the first line as the delimiter and split the document on the next occurrence. Personally, I find it a bit silly to optimize for outputting things in many different formats when you'll have to deal with tweaking the output for each format to get it right. And it's not a one and done deal. You'll still find things going wrong on occasion. :)
- joshribakoff 6y agoYeah my gatsby blog uses it too. Not sure why the author claimed only Hugo supports it.
- samatman 6y agoI'm fairly sure it came from Jekyll originally, rather than Hugo.
- lalaithion 6y agoPandoc: https://pandoc.org/MANUAL.html#metadata-blocks https://pandoc.org/MANUAL.html#metadata-blocks (scroll down a bit to "Extension: yaml_metadata_block")