diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-20 17:38:49 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-22 20:46:14 +0200 |
commit | eb038cfa0a8ada29dfcba1204ec5c432da9ed7e0 (patch) | |
tree | 9ed33e3517e49ef16f349b70b328feff47ee60d3 /hugolib | |
parent | 129c27ee6e9fed98dbfebeaa272fd52757b475b2 (diff) |
Convert the rest to new page parser code paths
And remove some now unused code.
See #5324
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/page.go | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index 2db0fb5d4..d13dfb246 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -36,7 +36,6 @@ import ( "github.com/gohugoio/hugo/resource" "github.com/gohugoio/hugo/output" - "github.com/gohugoio/hugo/parser" "github.com/mitchellh/mapstructure" "html/template" @@ -485,6 +484,7 @@ func (p *Page) MediaType() media.Type { return media.OctetType } +// TODO(bep) 2errors remove type Source struct { Frontmatter []byte Content []byte @@ -1725,36 +1725,6 @@ func (p *Page) SetSourceContent(content []byte) { p.Source.Content = content } -func (p *Page) SetSourceMetaData(in interface{}, mark rune) (err error) { - // See https://github.com/gohugoio/hugo/issues/2458 - defer func() { - if r := recover(); r != nil { - var ok bool - err, ok = r.(error) - if !ok { - err = fmt.Errorf("error from marshal: %v", r) - } - } - }() - - buf := bp.GetBuffer() - defer bp.PutBuffer(buf) - - err = parser.InterfaceToFrontMatter(in, mark, buf) - if err != nil { - return - } - - _, err = buf.WriteRune('\n') - if err != nil { - return - } - - p.Source.Frontmatter = buf.Bytes() - - return -} - func (p *Page) SafeSaveSourceAs(path string) error { return p.saveSourceAs(path, true) } |