spf13/hugo — pull request #419 by mohae (2014-08-18 03:30:34+00:00)
Title: added evaluation for toml for metadataformat date handling

When Hugo creates new content with front matter in TOML, the MetadataFormat for date is malformed, resulting in errors during page creation. The solution is to add `toml` to the relevant evaluations, which already support `json` and `yaml`.

Steps to replicate issue:
Compile from source.

`hugo new site sitename`
`cd sitename`
`hugo new hello.md`
`vi content/hello.md`

Results in:

+++
draft = true
title = "hello"date = 2015-08-17T22:12:40.262090604-5:00
+++

This results in an error when creating the site:

hugo server --buildDrafts
ERROR: 2014/08/17 Error parsing page meta data for hello.md
ERROR: 2014/08/17 Near line 3, key '': Near line 3: Expected a top-level item to end with a new line, comment or EOF, but got 'd' instead.
ERROR: 2014/08/17 Near line 3, key '': Near line 3: Expected a top-level item to end with a new line, comment or EOF, but got 'd' instead.
0 pages created...

The resolution is to add `toml` to the evaluations in `commands/convert.go` and `create/content.go`, which already evaluate for `json` and `yaml`.

This results in:

hugo new hello.md
vi content/hello.md

+++
date = "2014-08-17T22:24:22-05:00"
draft = true
title = "hello"
+++

hugo serve --buildDrafts
1 pages created