shithub: hugo

Download patch

ref: 803a0fce1ef3f2f42ed649a489ae381586445886
parent: 2ebfb33fe01d38a1341d6fe3c922dad5e93fd769
author: Noah Campbell <[email protected]>
date: Fri Sep 13 06:30:27 EDT 2013

Remove RenderedContent from page.

The output is written directly to disk after being written.  Not
entirely sure why it was split into two steps.

--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -40,7 +40,6 @@
 	Summary         template.HTML
 	RawMarkdown     string // TODO should be []byte
 	Params          map[string]interface{}
-	RenderedContent *bytes.Buffer
 	contentType     string
 	Draft           bool
 	Aliases         []string
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -110,7 +110,6 @@
 		}
 		return
 	}
-	s.Write()
 	return nil
 }
 
@@ -170,11 +169,6 @@
 	return
 }
 
-func (s *Site) Write() {
-	s.WritePages()
-	s.timerStep("write pages")
-}
-
 func (s *Site) checkDescriptions() {
 	for _, p := range s.Pages {
 		if len(p.Description) < 60 {
@@ -419,19 +413,12 @@
 		if err != nil {
 			return err
 		}
-		p.RenderedContent = content
-	}
-	return nil
-}
-
-func (s *Site) WritePages() (err error) {
-	for _, p := range s.Pages {
-		err = s.WritePublic(p.OutFile, p.RenderedContent.Bytes())
+		err = s.WritePublic(p.OutFile, content.Bytes())
 		if err != nil {
-			return
+			return err
 		}
 	}
-	return
+	return nil
 }
 
 func (s *Site) RenderIndexes() error {