Fix RenderString for pages without content

Fixes #6882
This commit is contained in:
Bjørn Erik Pedersen 2020-02-18 14:00:58 +01:00
parent 20f2211fce
commit 19e12caf8c
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
4 changed files with 62 additions and 13 deletions

View file

@ -14,6 +14,8 @@
package converter
import (
"bytes"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/identity"
@ -65,6 +67,18 @@ func (n newConverter) Name() string {
return n.name
}
var NopConverter = new(nopConverter)
type nopConverter int
func (nopConverter) Convert(ctx RenderContext) (Result, error) {
return &bytes.Buffer{}, nil
}
func (nopConverter) Supports(feature identity.Identity) bool {
return false
}
// Converter wraps the Convert method that converts some markup into
// another format, e.g. Markdown to HTML.
type Converter interface {