mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-25 01:31:27 +00:00
Merge pull request #19 from nsabine/master
Populated page Site metadata. Enables accessing Indexes from Page template.
This commit is contained in:
commit
d89c7ec7a2
1 changed files with 6 additions and 0 deletions
|
@ -271,6 +271,12 @@ func (s *Site) BuildSiteMeta() (err error) {
|
||||||
return errors.New(fmt.Sprintf("Unable to build site metadata, no pages found in directory %s", s.c.ContentDir))
|
return errors.New(fmt.Sprintf("Unable to build site metadata, no pages found in directory %s", s.c.ContentDir))
|
||||||
}
|
}
|
||||||
s.Info.LastChange = s.Pages[0].Date
|
s.Info.LastChange = s.Pages[0].Date
|
||||||
|
|
||||||
|
// populate pages with site metadata
|
||||||
|
for _, p := range s.Pages {
|
||||||
|
p.Site = s.Info
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue