Remove RenderedContent from page.

The output is written directly to disk after being written.  Not
entirely sure why it was split into two steps.
This commit is contained in:
Noah Campbell 2013-09-13 10:30:27 -07:00
parent 2ebfb33fe0
commit 803a0fce1e
2 changed files with 3 additions and 17 deletions

View file

@ -40,7 +40,6 @@ type Page struct {
Summary template.HTML Summary template.HTML
RawMarkdown string // TODO should be []byte RawMarkdown string // TODO should be []byte
Params map[string]interface{} Params map[string]interface{}
RenderedContent *bytes.Buffer
contentType string contentType string
Draft bool Draft bool
Aliases []string Aliases []string

View file

@ -110,7 +110,6 @@ func (s *Site) Build() (err error) {
} }
return return
} }
s.Write()
return nil return nil
} }
@ -170,11 +169,6 @@ func (s *Site) Render() (err error) {
return return
} }
func (s *Site) Write() {
s.WritePages()
s.timerStep("write pages")
}
func (s *Site) checkDescriptions() { func (s *Site) checkDescriptions() {
for _, p := range s.Pages { for _, p := range s.Pages {
if len(p.Description) < 60 { if len(p.Description) < 60 {
@ -419,19 +413,12 @@ func (s *Site) RenderPages() error {
if err != nil { if err != nil {
return err return err
} }
p.RenderedContent = content err = s.WritePublic(p.OutFile, content.Bytes())
}
return nil
}
func (s *Site) WritePages() (err error) {
for _, p := range s.Pages {
err = s.WritePublic(p.OutFile, p.RenderedContent.Bytes())
if err != nil { if err != nil {
return return err
} }
} }
return return nil
} }
func (s *Site) RenderIndexes() error { func (s *Site) RenderIndexes() error {