Support pages without front matter

* Page without front matter now treated same as a page with empty front matter.
* Test cases added to cover this and repro issue #4320.
* Type safety of front matter code improved.

Fixes #4320
This commit is contained in:
Vas Sudanagunta
2018-01-25 22:54:15 -05:00
committed by Bjørn Erik Pedersen
parent 3f0379adb7
commit 91bb774ae4
8 changed files with 56 additions and 42 deletions

View File

@@ -1231,9 +1231,7 @@ func (c *commandeer) isThemeVsHugoVersionMismatch() (mismatch bool, requiredMinV
return
}
config := tomlMeta.(map[string]interface{})
if minVersion, ok := config["min_version"]; ok {
if minVersion, ok := tomlMeta["min_version"]; ok {
return helpers.CompareVersion(minVersion) > 0, fmt.Sprint(minVersion)
}