From 6d3817d6cef6ceb924ec2f8d01db5f69a9057c50 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 1 Jul 2016 16:14:08 +0100 Subject: [PATCH] add confirm --- setup.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup.go b/setup.go index 2ab2cd68..5093aea6 100644 --- a/setup.go +++ b/setup.go @@ -6,6 +6,7 @@ import ( "net/http" "os" "path/filepath" + "reflect" "strings" "github.com/hacdias/caddy-filemanager" @@ -76,8 +77,17 @@ func setup(c *caddy.Controller) error { log.Panic(err) } - if val, ok := f.(map[string]interface{})["metaDataFormat"]; ok { - format = val.(string) + kind := reflect.TypeOf(f) + + if kind == reflect.TypeOf(map[interface{}]interface{}{}) { + if val, ok := f.(map[interface{}]interface{})["metaDataFormat"]; ok { + format = val.(string) + } + + } else { + if val, ok := f.(map[string]interface{})["metaDataFormat"]; ok { + format = val.(string) + } } // Generates the Hugo website for the first time the plugin is activated.