mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
create: Provide the correct .Site object to archetype templates
Fixes #4732
This commit is contained in:
parent
c71f201fd9
commit
ab02594e09
1 changed files with 2 additions and 2 deletions
|
@ -42,7 +42,7 @@ type ArchetypeFileData struct {
|
||||||
// used in the archetype template. Also, if this is a multilingual setup,
|
// 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
|
// this site is the site that best matches the target content file, based
|
||||||
// on the presence of language code in the filename.
|
// 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".
|
// 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.
|
// 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),
|
Date: time.Now().Format(time.RFC3339),
|
||||||
Name: name,
|
Name: name,
|
||||||
File: f,
|
File: f,
|
||||||
Site: s,
|
Site: &s.Info,
|
||||||
}
|
}
|
||||||
|
|
||||||
if archetypeFilename == "" {
|
if archetypeFilename == "" {
|
||||||
|
|
Loading…
Reference in a new issue