Output a timestamp with hugo server --watch
authorAustin Ziegler <austin@zieglers.ca>
Mon, 27 Oct 2014 21:23:54 +0000 (17:23 -0400)
committerspf13 <steve.francia@gmail.com>
Sun, 2 Nov 2014 04:29:11 +0000 (00:29 -0400)
Per a [discussion][thread] on discuss, I have implemented one possible
way to do this.

[thread]: http://discuss.gohugo.io/t/output-a-timestamp-with-hugo-watch/213

commands/hugo.go

index 810a71444ceafe72e01fcf7d95590ba1c8e75ed2..2fece29c87e4d5031d95603feb992466791dc922 100644 (file)
@@ -371,7 +371,9 @@ func NewWatcher(port int) error {
                                }
 
                                if dynamic_changed {
-                                       fmt.Print("Change detected, rebuilding site\n\n")
+                                       fmt.Print("\nChange detected, rebuilding site\n")
+                                       const layout = "2006-01-02 15:04 -0700"
+                                       fmt.Println(time.Now().Format(layout))
                                        utils.StopOnErr(buildSite(true))
 
                                        if !viper.GetBool("DisableLiveReload") {