diff --git a/middleware/markdown/metadata.go b/middleware/markdown/metadata.go index 11b7f32a..afab4daa 100644 --- a/middleware/markdown/metadata.go +++ b/middleware/markdown/metadata.go @@ -12,9 +12,9 @@ import ( var ( parsers = []MetadataParser{ - &JSONMetadataParser{}, - &TOMLMetadataParser{}, - &YAMLMetadataParser{}, + &JSONMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}}, + &TOMLMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}}, + &YAMLMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}}, } ) diff --git a/middleware/markdown/process.go b/middleware/markdown/process.go index ffcd456d..9dc5778f 100644 --- a/middleware/markdown/process.go +++ b/middleware/markdown/process.go @@ -21,7 +21,7 @@ const ( // process processes the contents of a page. // It parses the metadata (if any) and uses the template (if found) func (md Markdown) process(c Config, requestPath string, b []byte) ([]byte, error) { - var metadata = Metadata{} + var metadata = Metadata{Variables: make(map[string]interface{})} var markdown []byte var err error