hugolib: Add missing zero check on file

This commit is contained in:
Bjørn Erik Pedersen 2020-06-26 13:27:01 +02:00
parent 057b1377c5
commit ccfaeb678b
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
1 changed files with 3 additions and 1 deletions

View File

@ -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,
},
)