From: Nick Sabine Date: Wed, 7 Aug 2013 18:23:24 +0000 (-0400) Subject: Populated page Site metadata. Enables accessing Indexes from Page template. X-Git-Tag: v0.9~178^2 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=780e2f311b517d128b0eb9144f8a033885ac611e;p=brevno-suite%2Fhugo Populated page Site metadata. Enables accessing Indexes from Page template. --- diff --git a/hugolib/site.go b/hugolib/site.go index b2eb70cf..0b052a4f 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -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)) } s.Info.LastChange = s.Pages[0].Date + + // populate pages with site metadata + for _, p := range s.Pages { + p.Site = s.Info + } + return }