mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -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) {
|
func (s *Site) RenderIndexes() (err error) {
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
for singular, plural := range s.Config.Indexes {
|
for sing, pl := range s.Config.Indexes {
|
||||||
for key, oo := range s.Indexes[plural] {
|
for key, oo := range s.Indexes[pl] {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
go func(k string, o WeightedPages, singular string, plural string) (err error) {
|
||||||
go func(k string, o WeightedPages) (err error) {
|
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
base := plural + "/" + k
|
||||||
n := s.NewNode()
|
n := s.NewNode()
|
||||||
n.Title = strings.Title(k)
|
n.Title = strings.Title(k)
|
||||||
base := plural + "/" + k
|
|
||||||
s.setUrls(n, base)
|
s.setUrls(n, base)
|
||||||
n.Date = o[0].Page.Date
|
n.Date = o[0].Page.Date
|
||||||
n.Data[singular] = o
|
n.Data[singular] = o
|
||||||
|
@ -439,7 +438,7 @@ func (s *Site) RenderIndexes() (err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}(key, oo)
|
}(key, oo, sing, pl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
Loading…
Reference in a new issue