shithub: hugo

Download patch

ref: dcfcbac58997f3a329fed636d8fbc5aede42ffcf
parent: 18f2b82658b6f0ea82c867c2c4d40cf0772841d2
author: spf13 <[email protected]>
date: Thu Oct 3 05:44:45 EDT 2013

Enabling Nitro ('--stepAnalysis') again. Fix #58

--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -19,6 +19,7 @@
 	"github.com/mostafah/fsync"
 	"github.com/spf13/cobra"
 	"github.com/spf13/hugo/hugolib"
+	"github.com/spf13/nitro"
 	"log"
 	"os"
 	"path/filepath"
@@ -66,6 +67,7 @@
 	HugoCmd.PersistentFlags().BoolVar(&UglyUrls, "uglyurls", false, "if true, use /filename.html instead of /filename/")
 	HugoCmd.PersistentFlags().StringVarP(&BaseUrl, "base-url", "b", "", "hostname (and path) to the root eg. http://spf13.com/")
 	HugoCmd.PersistentFlags().StringVar(&CfgFile, "config", "", "config file (default is path/config.yaml|json|toml)")
+	HugoCmd.PersistentFlags().BoolVar(&nitro.AnalysisOn, "stepAnalysis", false, "display memory and timing of different steps of the program")
 	HugoCmd.Flags().BoolVarP(&BuildWatch, "watch", "w", false, "watch filesystem for changes and recreate as needed")
 }
 
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -31,7 +31,7 @@
 	"time"
 )
 
-var DefaultTimer = nitro.Initalize()
+var DefaultTimer *nitro.B
 
 func MakePermalink(base *url.URL, path *url.URL) *url.URL {
 	return base.ResolveReference(path)
@@ -76,6 +76,10 @@
 	LastChange time.Time
 	Title      string
 	Config     *Config
+}
+
+func init() {
+	DefaultTimer = nitro.Initalize()
 }
 
 func (s *Site) timerStep(step string) {