mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
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:
parent
2ebfb33fe0
commit
803a0fce1e
2 changed files with 3 additions and 17 deletions
|
@ -40,7 +40,6 @@ type Page struct {
|
|||
Summary template.HTML
|
||||
RawMarkdown string // TODO should be []byte
|
||||
Params map[string]interface{}
|
||||
RenderedContent *bytes.Buffer
|
||||
contentType string
|
||||
Draft bool
|
||||
Aliases []string
|
||||
|
|
|
@ -110,7 +110,6 @@ func (s *Site) Build() (err error) {
|
|||
}
|
||||
return
|
||||
}
|
||||
s.Write()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -170,11 +169,6 @@ func (s *Site) Render() (err error) {
|
|||
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,21 +413,14 @@ func (s *Site) RenderPages() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p.RenderedContent = content
|
||||
err = s.WritePublic(p.OutFile, content.Bytes())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Site) WritePages() (err error) {
|
||||
for _, p := range s.Pages {
|
||||
err = s.WritePublic(p.OutFile, p.RenderedContent.Bytes())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Site) RenderIndexes() error {
|
||||
for singular, plural := range s.Config.Indexes {
|
||||
for k, o := range s.Indexes[plural] {
|
||||
|
|
Loading…
Reference in a new issue