ref: 780e2f311b517d128b0eb9144f8a033885ac611e
parent: 42de9bd8bb08ea944cb6258503fd6e5eb5198d4f
author: Nick Sabine <[email protected]>
date: Wed Aug 7 10:23:24 EDT 2013
Populated page Site metadata. Enables accessing Indexes from Page template.
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -271,6 +271,12 @@
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
}