summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_build.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/hugo_sites_build.go')
-rw-r--r--hugolib/hugo_sites_build.go34
1 files changed, 7 insertions, 27 deletions
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go
index c0749e388..b2b394eb5 100644
--- a/hugolib/hugo_sites_build.go
+++ b/hugolib/hugo_sites_build.go
@@ -15,7 +15,6 @@ package hugolib
import (
"bytes"
- "time"
"errors"
@@ -30,7 +29,7 @@ func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
h.Metrics.Reset()
}
- t0 := time.Now()
+ //t0 := time.Now()
// Need a pointer as this may be modified.
conf := &config
@@ -63,10 +62,6 @@ func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
return err
}
- if config.PrintStats {
- h.Log.FEEDBACK.Printf("total in %v ms\n", int(1000*time.Since(t0).Seconds()))
- }
-
if h.Metrics != nil {
var b bytes.Buffer
h.Metrics.WriteMetrics(&b)
@@ -101,8 +96,6 @@ func (h *HugoSites) init(config *BuildCfg) error {
}
}
- h.runMode.Watching = config.Watching
-
return nil
}
@@ -115,12 +108,10 @@ func (h *HugoSites) initRebuild(config *BuildCfg) error {
return errors.New("Rebuild does not support 'ResetState'.")
}
- if !config.Watching {
+ if !h.running {
return errors.New("Rebuild called when not in watch mode")
}
- h.runMode.Watching = config.Watching
-
if config.whatChanged.source {
// This is for the non-renderable content pages (rarely used, I guess).
// We could maybe detect if this is really needed, but it should be
@@ -147,7 +138,7 @@ func (h *HugoSites) process(config *BuildCfg, events ...fsnotify.Event) error {
if len(events) > 0 {
// This is a rebuild
- changed, err := firstSite.reProcess(events)
+ changed, err := firstSite.processPartial(events)
config.whatChanged = &changed
return err
}
@@ -188,25 +179,19 @@ func (h *HugoSites) assemble(config *BuildCfg) error {
}
for _, s := range h.Sites {
- s.siteStats = &siteStats{}
for _, p := range s.Pages {
// May have been set in front matter
if len(p.outputFormats) == 0 {
p.outputFormats = s.outputFormats[p.Kind]
}
-
- cnt := len(p.outputFormats)
- if p.Kind == KindPage {
- s.siteStats.pageCountRegular += cnt
+ for _, r := range p.Resources.ByType(pageResourceType) {
+ r.(*Page).outputFormats = p.outputFormats
}
- s.siteStats.pageCount += cnt
- if err := p.initTargetPathDescriptor(); err != nil {
- return err
- }
- if err := p.initURLs(); err != nil {
+ if err := p.initPaths(); err != nil {
return err
}
+
}
s.assembleMenus()
s.refreshPageCaches()
@@ -222,7 +207,6 @@ func (h *HugoSites) assemble(config *BuildCfg) error {
}
func (h *HugoSites) render(config *BuildCfg) error {
-
for _, s := range h.Sites {
s.initRenderFormats()
for i, rf := range s.renderFormats {
@@ -235,10 +219,6 @@ func (h *HugoSites) render(config *BuildCfg) error {
}
}
}
-
- if !config.SkipRender && config.PrintStats {
- s.Stats()
- }
}
if !config.SkipRender {