mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Fixes #227 by properly scoping the variables within the go routine.
This commit is contained in:
parent
85c04ca2f3
commit
6205a16b6e
1 changed files with 5 additions and 6 deletions
|
@ -411,15 +411,14 @@ func (s *Site) RenderPages() (err error) {
|
|||
|
||||
func (s *Site) RenderIndexes() (err error) {
|
||||
var wg sync.WaitGroup
|
||||
for singular, plural := range s.Config.Indexes {
|
||||
for key, oo := range s.Indexes[plural] {
|
||||
for sing, pl := range s.Config.Indexes {
|
||||
for key, oo := range s.Indexes[pl] {
|
||||
wg.Add(1)
|
||||
|
||||
go func(k string, o WeightedPages) (err error) {
|
||||
go func(k string, o WeightedPages, singular string, plural string) (err error) {
|
||||
defer wg.Done()
|
||||
base := plural + "/" + k
|
||||
n := s.NewNode()
|
||||
n.Title = strings.Title(k)
|
||||
base := plural + "/" + k
|
||||
s.setUrls(n, base)
|
||||
n.Date = o[0].Page.Date
|
||||
n.Data[singular] = o
|
||||
|
@ -439,7 +438,7 @@ func (s *Site) RenderIndexes() (err error) {
|
|||
}
|
||||
}
|
||||
return
|
||||
}(key, oo)
|
||||
}(key, oo, sing, pl)
|
||||
}
|
||||
}
|
||||
wg.Wait()
|
||||
|
|
Loading…
Reference in a new issue