From 8cc7684a91f6c83f0f68024deb9f98b330911d2f Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Fri, 31 Oct 2014 23:58:14 -0400 Subject: [PATCH] =?UTF-8?q?Change=20the=20type=20of=20.Site.Author=20from?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …`map[string]string` to `map[string]interface{}`. This allows values other than `string` values to be saved to Author, such as: ```toml # config.toml … [Author] name = "Austin Ziegler" social-site = [ "Facebook", "Twitter", "GitHub" ] ``` My specific use-case is that I’m trying to make something work similar whether it’s specified in `.Params.Author` or in `.Site.Author` without introducing `.Site.Params.Author`. --- hugolib/site.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hugolib/site.go b/hugolib/site.go index a3c8d07f3..c8a9b81a2 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -88,7 +88,7 @@ type SiteInfo struct { Recent *Pages // legacy, should be identical to Pages Menus *Menus Title string - Author map[string]string + Author map[string]interface{} LanguageCode string DisqusShortname string Copyright string @@ -279,7 +279,7 @@ func (s *Site) initializeSiteInfo() { s.Info = SiteInfo{ BaseUrl: template.URL(helpers.SanitizeUrl(viper.GetString("BaseUrl"))), Title: viper.GetString("Title"), - Author: viper.GetStringMapString("author"), + Author: viper.GetStringMap("author"), LanguageCode: viper.GetString("languagecode"), Copyright: viper.GetString("copyright"), DisqusShortname: viper.GetString("DisqusShortname"),