From: Bjørn Erik Pedersen Date: Fri, 25 May 2018 15:35:06 +0000 (+0200) Subject: create: Provide the correct .Site object to archetype templates X-Git-Tag: v0.41~5 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ab02594e09c0414124186e42d67d52d474dd341a;p=brevno-suite%2Fhugo create: Provide the correct .Site object to archetype templates Fixes #4732 --- diff --git a/create/content_template_handler.go b/create/content_template_handler.go index e9e7cb62..17e52cae 100644 --- a/create/content_template_handler.go +++ b/create/content_template_handler.go @@ -42,7 +42,7 @@ type ArchetypeFileData struct { // used in the archetype template. Also, if this is a multilingual setup, // this site is the site that best matches the target content file, based // on the presence of language code in the filename. - Site *hugolib.Site + Site *hugolib.SiteInfo // Name will in most cases be the same as TranslationBaseName, e.g. "my-post". // But if that value is "index" (bundles), the Name is instead the owning folder. @@ -108,7 +108,7 @@ func executeArcheTypeAsTemplate(s *hugolib.Site, kind, targetPath, archetypeFile Date: time.Now().Format(time.RFC3339), Name: name, File: f, - Site: s, + Site: &s.Info, } if archetypeFilename == "" {