NewContent is refactored to use the afero.Fs interface that should allow
full testing. This commit also pulls the metadata creation logic out of
NewContent and into a separate function to decrease the cyclomatic
complexity of NewContent.
So that the date would come out correctly with
variations like `MetaDataFormat = "YAML"` in addition to
the normally expected `MetaDataFormat = "yaml"`.
Fixes#865.
If an archetype has deliberately empty front matter (e.g., to suppress
generation of the 'draft' field or to force a particular front matter type
instead of the default TOML), we should handle it gracefully rather than
panic ("assignment to entry in nil map").
Prior to this commit only metadata were copied from archetype on content creation.
This commit includes the content if set in archetype. This is useful in situations with similar page structure.
Fixes#556