hugolib: Add missing zero check on file - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit ccfaeb678b312535928af3451324a54f2c7cb199
DIR parent 057b1377c5f4d0d80ee299293db06384a475ad19
HTML Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date: Fri, 26 Jun 2020 13:27:01 +0200
hugolib: Add missing zero check on file
Diffstat:
M hugolib/page__meta.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
DIR diff --git a/hugolib/page__meta.go b/hugolib/page__meta.go
@@ -728,8 +728,10 @@ func (p *pageMeta) newContentConverter(ps *pageState, markup string, renderingCo
}
var id string
+ var filename string
if !p.f.IsZero() {
id = p.f.UniqueID()
+ filename = p.f.Filename()
}
cpp, err := cp.New(
@@ -737,7 +739,7 @@ func (p *pageMeta) newContentConverter(ps *pageState, markup string, renderingCo
Document: newPageForRenderHook(ps),
DocumentID: id,
DocumentName: p.Path(),
- Filename: p.f.Filename(),
+ Filename: filename,
ConfigOverrides: renderingConfigOverrides,
},
)