1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

hugolib: Speed up URL handling

This commit is contained in:
Bjørn Erik Pedersen
2017-03-17 16:35:09 +01:00
parent a49bf8707b
commit df95383914
7 changed files with 56 additions and 25 deletions

View File

@@ -44,8 +44,18 @@ func (p *PageOutput) targetPath(addends ...string) (string, error) {
}
func newPageOutput(p *Page, createCopy bool, f output.Format) (*PageOutput, error) {
// For tests
// TODO(bep) output get rid of this
if p.targetPathDescriptorPrototype == nil {
if err := p.initTargetPathDescriptor(); err != nil {
return nil, err
}
if err := p.initURLs(); err != nil {
return nil, err
}
}
if createCopy {
p.initURLs()
p = p.copy()
}