Cache processed images by their source path

Fixes #6269
This commit is contained in:
Bjørn Erik Pedersen
2019-09-03 10:36:09 +02:00
parent 018494f363
commit 8624b9fe9e
9 changed files with 127 additions and 33 deletions

View File

@@ -22,6 +22,8 @@ import (
"path/filepath"
"strings"
"github.com/gohugoio/hugo/hugofs"
"github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/cache/filecache"
@@ -194,8 +196,13 @@ func (r *Spec) newGenericResourceWithBase(
relTargetDirFile: dirFile{dir: fpath, file: fname},
}
var fim hugofs.FileMetaInfo
if osFileInfo != nil {
fim = osFileInfo.(hugofs.FileMetaInfo)
}
gfi := &resourceFileInfo{
fi: osFileInfo,
fi: fim,
openReadSeekerCloser: openReadSeekerCloser,
sourceFs: sourceFs,
sourceFilename: sourceFilename,