diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-09-03 10:36:09 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-09-03 18:38:57 +0200 |
commit | 8624b9fe9eb81aeb884d36311fb6f85fed98aa43 (patch) | |
tree | 830fcb271584065cc6577c17808ade64cdb68b88 /resources/resource.go | |
parent | 018494f363a32b9e4d3622da6842bc3e59b420b2 (diff) | |
download | hugo-8624b9fe9eb81aeb884d36311fb6f85fed98aa43.tar.gz hugo-8624b9fe9eb81aeb884d36311fb6f85fed98aa43.zip |
Cache processed images by their source path
Fixes #6269
Diffstat (limited to 'resources/resource.go')
-rw-r--r-- | resources/resource.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/resources/resource.go b/resources/resource.go index 3859e6044..637f8e8fd 100644 --- a/resources/resource.go +++ b/resources/resource.go @@ -22,6 +22,8 @@ import ( "path/filepath" "sync" + "github.com/gohugoio/hugo/hugofs" + "github.com/gohugoio/hugo/media" "github.com/gohugoio/hugo/source" @@ -172,6 +174,7 @@ type fileInfo interface { getSourceFilename() string setSourceFilename(string) setSourceFs(afero.Fs) + getFileInfo() hugofs.FileMetaInfo hash() (string, error) size() int } @@ -537,7 +540,7 @@ type resourceFileInfo struct { // the path to the file on the real filesystem. sourceFilename string - fi os.FileInfo + fi hugofs.FileMetaInfo // A hash of the source content. Is only calculated in caching situations. h *resourceHash @@ -555,6 +558,10 @@ func (fi *resourceFileInfo) ReadSeekCloser() (hugio.ReadSeekCloser, error) { return f, nil } +func (fi *resourceFileInfo) getFileInfo() hugofs.FileMetaInfo { + return fi.fi +} + func (fi *resourceFileInfo) getSourceFilename() string { return fi.sourceFilename } |