diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-02-18 16:00:58 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-02-18 16:08:59 +0300 |
commit | 19e12caf8c90516e3b803ae8a40b907bd89dc96c (patch) | |
tree | b3640819a334588ab5c684d540ac177c34ffad15 /markup/converter | |
parent | 20f2211fce55e1811629245f9e5e4a2ac754d788 (diff) |
Fix RenderString for pages without content
Fixes #6882
Diffstat (limited to 'markup/converter')
-rw-r--r-- | markup/converter/converter.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/markup/converter/converter.go b/markup/converter/converter.go index b8a5c92c1..353775826 100644 --- a/markup/converter/converter.go +++ b/markup/converter/converter.go @@ -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 { |