mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
parent
eaba04e82b
commit
c7acc318b5
1 changed files with 14 additions and 0 deletions
|
@ -469,6 +469,9 @@ func (s *Site) ReBuild(events []fsnotify.Event) error {
|
|||
s.ReadDataFromSourceFS()
|
||||
}
|
||||
|
||||
// we reuse the state, so have to do some cleanup before we can rebuild.
|
||||
s.resetPageBuildState()
|
||||
|
||||
// If a content file changes, we need to reload only it and re-render the entire site.
|
||||
if len(sourceChanged) > 0 {
|
||||
|
||||
|
@ -1303,6 +1306,17 @@ func (s *Site) assembleTaxonomies() {
|
|||
s.Info.Sections = s.Sections
|
||||
}
|
||||
|
||||
// Prepare pages for a new full build.
|
||||
func (s *Site) resetPageBuildState() {
|
||||
|
||||
s.Info.paginationPageCount = 0
|
||||
|
||||
for _, p := range s.Pages {
|
||||
p.scratch = newScratch()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Site) assembleSections() {
|
||||
for i, p := range s.Pages {
|
||||
s.Sections.Add(p.Section(), WeightedPage{s.Pages[i].Weight, s.Pages[i]}, s.Info.preserveTaxonomyNames)
|
||||
|
|
Loading…
Reference in a new issue