mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-30 00:33:31 -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
|
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
|
||||||
|
|
|
@ -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,21 +413,14 @@ 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())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
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 {
|
func (s *Site) RenderIndexes() error {
|
||||||
for singular, plural := range s.Config.Indexes {
|
for singular, plural := range s.Config.Indexes {
|
||||||
for k, o := range s.Indexes[plural] {
|
for k, o := range s.Indexes[plural] {
|
||||||
|
|
Loading…
Reference in a new issue